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.
12 UNAME= $(shell uname -s)
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
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
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
28 ifeq ($(UNAME), Darwin)
29 CFLAGS+= -DHAVE_FFLAGS
32 LDFLAGS= -L$(PREFIX)/lib -lcrypto -lz -lpthread
34 .PHONY: all clean install
39 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
50 rm -f csup $(OBJS) parse.c parse.h token.c csup.1.gz
53 $(CC) $(CFLAGS) -c -o $@ $<
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