source: trunk/Makefile @ 88

Last change on this file since 88 was 88, checked in by tim, 17 years ago

Fixed a lazy NULL printing to work properly on Solaris.

Switched reglookup exit codes to more standard ones.

Changed Makefile to default to using -liconv except on Linux, since Solaris needs this too.

  • Property svn:keywords set to Id
File size: 969 bytes
RevLine 
[13]1# $Id: Makefile 88 2007-03-07 01:35:18Z 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
[88]13OPTS=-std=gnu89 -pedantic -Wall
[73]14INC=-I/usr/local/include
15LIB=-L/usr/local/lib
[5]16
[73]17UNAME := $(shell uname)
[88]18ifneq ($(UNAME),Linux) 
[74]19  LIB:=$(LIB) -liconv
[73]20endif
21
[5]22BUILD=$(CURDIR)/build
23BUILD_BIN=$(BUILD)/bin
[9]24BUILD_DOC=$(BUILD)/doc
[5]25
[21]26BUILD_TREE=$(BUILD_BIN) $(BUILD_DOC)
[65]27SUB_DIRS=lib src doc bin
[5]28
29FILES=$(REGLOOKUP)
30.PHONY: $(SUB_DIRS) clean
31export
32
33
34all: $(BUILD_TREE) $(SUB_DIRS)
35
[20]36#XXX: This should be more generalized.
[11]37install: all
[13]38        mkdir -p $(BIN_PREFIX)
39        mkdir -p $(DOC_PREFIX)
[20]40        mkdir -p $(MAN_PREFIX)/man1
[67]41        $(MAKE) -C bin install
[26]42        $(MAKE) -C src install
[25]43        $(MAKE) -C doc install
[11]44
[13]45
[5]46$(SUB_DIRS):
47        $(MAKE) -C $@
48
49$(BUILD_TREE):
50        mkdir -p $@
51
52clean:
[39]53        $(MAKE) -C src clean
54        $(MAKE) -C lib clean
[5]55        rm -rf $(BUILD)/*
Note: See TracBrowser for help on using the repository browser.