]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/csup/GNUmakefile
This commit was generated by cvs2svn to compensate for changes in r169691,
[FreeBSD/FreeBSD.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 lister.c main.c misc.c mux.c pathcomp.c \
16         parse.c proto.c status.c stream.c threads.c token.c updater.c
17 OBJS=   $(SRCS:.c=.o)
18
19 WARNS=  -Wall -W -Wno-unused-parameter -Wmissing-prototypes -Wpointer-arith \
20         -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow \
21         -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline \
22         -Wnested-externs -Wredundant-decls -Wno-format-y2k
23
24 CFLAGS+= -g -O -pipe -DNDEBUG -I$(PREFIX)/include
25 ifeq ($(UNAME), Linux)
26         CFLAGS+= -D_XOPEN_SOURCE -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
27 endif
28 ifeq ($(UNAME), Darwin)
29         CFLAGS+= -DHAVE_FFLAGS
30 endif
31 CFLAGS+= $(WARNS)
32 LDFLAGS= -L$(PREFIX)/lib -lcrypto -lz -lpthread
33
34 .PHONY: all clean install
35
36 all: csup csup.1.gz
37
38 csup: $(OBJS)
39         $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
40
41 config.c: parse.h
42
43 token.c: token.l
44
45 parse.c: parse.y
46
47 parse.h: parse.c
48
49 clean:
50         rm -f csup $(OBJS) parse.c parse.h token.c csup.1.gz
51
52 %.o: %.c
53         $(CC) $(CFLAGS) -c -o $@ $<
54
55 %.c: %.y
56         $(YACC) -d -o $@ $<
57
58 csup.1.gz: csup.1
59         gzip -cn $< > $@
60
61 install: csup csup.1.gz
62         install -s -o $(OWNER) -g $(GROUP) csup $(PREFIX)/bin
63         install -s -o $(OWNER) -g $(GROUP) csup.1.gz $(PREFIX)/share/man/man1