source: trunk/Makefile @ 20

Last change on this file since 20 was 20, checked in by tim, 19 years ago

Added INSTALL documentation

Made Makefile slightly more flexible.

  • Property svn:keywords set to Id
File size: 1.5 KB
RevLine 
[13]1# $Id: Makefile 20 2005-06-07 23:54:16Z 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
13OPTS=-ggdb -std=gnu89 -pedantic -Wall
14#OPTS=-std=gnu89 -pedantic -Wall
15
16BUILD=$(CURDIR)/build
17BUILD_BIN=$(BUILD)/bin
[9]18BUILD_DOC=$(BUILD)/doc
[5]19
[9]20BUILD_TREE=$(BUILD_BIN) $(BUILD_ETC) $(BUILD_DOC)
21SUB_DIRS=src doc
[5]22
23FILES=$(REGLOOKUP)
24.PHONY: $(SUB_DIRS) clean
25export
26
27
28all: $(BUILD_TREE) $(SUB_DIRS)
29
[20]30#XXX: This should be more generalized.
[11]31install: all
[13]32        mkdir -p $(BIN_PREFIX)
33        mkdir -p $(DOC_PREFIX)
[20]34        mkdir -p $(MAN_PREFIX)/man1
[13]35        cp -r $(BUILD_BIN)/* $(BIN_PREFIX)
36        cp -r $(BUILD_DOC)/* $(DOC_PREFIX)
37        #     Possibly move it to doc/Makefile
[14]38        cp -sf $(DOC_PREFIX)/man/man1/*  $(MAN_PREFIX)/man1
[11]39
[13]40
[5]41$(SUB_DIRS):
42        $(MAKE) -C $@
43
44$(BUILD_TREE):
45        mkdir -p $@
46
47clean:
48        rm -rf $(BUILD)/*
[11]49
50
51# For developer use only
[20]52RELEASE_VER=0.1.1
53#RELEASE_SRC=releases/release-$(RELEASE_VER)
54RELEASE_SRC=trunk
[11]55RELEASE_DEST=.
56.release:
57        rm -rf .release
58        mkdir .release
[20]59        svn export svn+ssh://sentinelchicken.org/home/projects/subversion/reglookup/$(RELEASE_SRC)/\
[11]60                .release/reglookup-$(RELEASE_VER)
61        cd .release/reglookup-$(RELEASE_VER)/doc && make generate
62        cd .release\
63                && tar cf reglookup-$(RELEASE_VER).tar reglookup-$(RELEASE_VER)\
64                && gzip -9 reglookup-$(RELEASE_VER).tar
65        mv .release/reglookup-$(RELEASE_VER).tar.gz $(RELEASE_DEST)
66        rm -rf .release
Note: See TracBrowser for help on using the repository browser.