]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/csup/GNUmakefile
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / contrib / csup / GNUmakefile
1 # A simple gmake Makefile, to be used on Linux and Darwin.  It shouldn't
2 # be used elsewhere because it assumes that the target system doesn't
3 # support BSD extended file flags.
4 #
5 # $FreeBSD$
6 #
7
8 PREFIX?=/usr/local
9 OWNER?= 0
10 GROUP?= 0
11
12 UNAME=  $(shell uname -s)
13
14 SRCS=   attrstack.c config.c detailer.c diff.c fattr.c fixups.c fnmatch.c \
15         globtree.c idcache.c keyword.c lex.rcs.c lister.c main.c misc.c mux.c \
16         pathcomp.c parse.c proto.c rcsfile.c rcsparse.c rsyncfile.c status.c \
17         stream.c threads.c token.c updater.c
18 OBJS=   $(SRCS:.c=.o)
19
20 WARNS=  -Wall -W -Wno-unused-parameter -Wmissing-prototypes -Wpointer-arith \
21         -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow \
22         -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline \
23         -Wnested-externs -Wredundant-decls -Wno-format-y2k
24
25 CFLAGS+= -g -O -pipe -DNDEBUG -I$(PREFIX)/include
26 ifeq ($(UNAME), Linux)
27         CFLAGS+= -D_XOPEN_SOURCE -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
28 endif
29 ifeq ($(UNAME), Darwin)
30         CFLAGS+= -DHAVE_FFLAGS
31 endif
32 CFLAGS+= $(WARNS)
33 LDFLAGS= -L$(PREFIX)/lib -lcrypto -lz -lpthread
34
35 .PHONY: all clean install
36
37 all: csup csup.1.gz
38
39 csup: $(OBJS)
40         $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
41
42 config.c: parse.h
43
44 token.c: token.l
45
46 parse.c: parse.y
47
48 parse.h: parse.c
49
50 clean:
51         rm -f csup $(OBJS) parse.c parse.h token.c csup.1.gz
52
53 %.o: %.c
54         $(CC) $(CFLAGS) -c -o $@ $<
55
56 %.c: %.y
57         $(YACC) -d -o $@ $<
58
59 csup.1.gz: csup.1
60         gzip -cn $< > $@
61
62 install: csup csup.1.gz
63         install -s -o $(OWNER) -g $(GROUP) csup $(PREFIX)/bin
64         install -s -o $(OWNER) -g $(GROUP) csup.1.gz $(PREFIX)/share/man/man1