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
RevLine 
[13]1# $Id: Makefile 143 2009-02-13 03:24:27Z tim $
[5]2
[13]3# Installation prefixes.  Change to install elsewhere.
[5]4
5PREFIX=/usr/local
[13]6BIN_PREFIX=$(PREFIX)/bin
7DOC_PREFIX=$(PREFIX)/share/doc/reglookup
8MAN_PREFIX=$(PREFIX)/man
[5]9
10################################################################################
11
12CC=gcc
[141]13#OPTS=-std=gnu89 -pedantic -Wall -ggdb
14OPTS=-std=gnu89 -pedantic -Wall
[73]15INC=-I/usr/local/include
[98]16LIB=-L/usr/local/lib -lm
[143]17BIN_EXT=
18EXTRA_OBJ=
[5]19
[73]20UNAME := $(shell uname)
[88]21ifneq ($(UNAME),Linux) 
[74]22  LIB:=$(LIB) -liconv
[73]23endif
24
[143]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
[5]33BUILD=$(CURDIR)/build
34BUILD_BIN=$(BUILD)/bin
[9]35BUILD_DOC=$(BUILD)/doc
[5]36
[21]37BUILD_TREE=$(BUILD_BIN) $(BUILD_DOC)
[65]38SUB_DIRS=lib src doc bin
[5]39
40FILES=$(REGLOOKUP)
41.PHONY: $(SUB_DIRS) clean
42export
43
44
45all: $(BUILD_TREE) $(SUB_DIRS)
46
[20]47#XXX: This should be more generalized.
[11]48install: all
[13]49        mkdir -p $(BIN_PREFIX)
50        mkdir -p $(DOC_PREFIX)
[20]51        mkdir -p $(MAN_PREFIX)/man1
[67]52        $(MAKE) -C bin install
[26]53        $(MAKE) -C src install
[25]54        $(MAKE) -C doc install
[11]55
[13]56
[5]57$(SUB_DIRS):
58        $(MAKE) -C $@
59
60$(BUILD_TREE):
61        mkdir -p $@
62
63clean:
[39]64        $(MAKE) -C src clean
65        $(MAKE) -C lib clean
[5]66        rm -rf $(BUILD)/*
Note: See TracBrowser for help on using the repository browser.