source: trunk/Makefile @ 143

Last change on this file since 143 was 143, checked in by tim, 16 years ago

fixed a null pointer exception

removed some dependencies on less portable items

altered Makefiles to allow for MinGW cross compiling

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1# $Id: Makefile 143 2009-02-13 03:24:27Z tim $
2
3# Installation prefixes.  Change to install elsewhere.
4
5PREFIX=/usr/local
6BIN_PREFIX=$(PREFIX)/bin
7DOC_PREFIX=$(PREFIX)/share/doc/reglookup
8MAN_PREFIX=$(PREFIX)/man
9
10################################################################################
11
12CC=gcc
13#OPTS=-std=gnu89 -pedantic -Wall -ggdb
14OPTS=-std=gnu89 -pedantic -Wall
15INC=-I/usr/local/include
16LIB=-L/usr/local/lib -lm
17BIN_EXT=
18EXTRA_OBJ=
19
20UNAME := $(shell uname)
21ifneq ($(UNAME),Linux) 
22  LIB:=$(LIB) -liconv
23endif
24
25ifdef BUILD_MINGW
26CC=i586-mingw32msvc-cc
27BIN_EXT=.exe
28LIBICONV_PATH=/usr/local/src/libiconv-1.9.2-1-lib
29INC:=$(INC) -I$(LIBICONV_PATH)/include
30EXTRA_OBJ=$(LIBICONV_PATH)/lib/libiconv.dll.a
31endif
32
33BUILD=$(CURDIR)/build
34BUILD_BIN=$(BUILD)/bin
35BUILD_DOC=$(BUILD)/doc
36
37BUILD_TREE=$(BUILD_BIN) $(BUILD_DOC)
38SUB_DIRS=lib src doc bin
39
40FILES=$(REGLOOKUP)
41.PHONY: $(SUB_DIRS) clean
42export
43
44
45all: $(BUILD_TREE) $(SUB_DIRS)
46
47#XXX: This should be more generalized.
48install: all
49        mkdir -p $(BIN_PREFIX)
50        mkdir -p $(DOC_PREFIX)
51        mkdir -p $(MAN_PREFIX)/man1
52        $(MAKE) -C bin install
53        $(MAKE) -C src install
54        $(MAKE) -C doc install
55
56
57$(SUB_DIRS):
58        $(MAKE) -C $@
59
60$(BUILD_TREE):
61        mkdir -p $@
62
63clean:
64        $(MAKE) -C src clean
65        $(MAKE) -C lib clean
66        rm -rf $(BUILD)/*
Note: See TracBrowser for help on using the repository browser.