summarylogtreecommitdiffstats
path: root/GNUmakefile
blob: be74ce74650e0f36d1d12f4896a5b0eff99e4270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
SRCS = cpdup.c fsmid.c hclink.c hcproto.c misc.c
OBJS = $(SRCS:%.c=%.o)
DEPS = $(SRCS:%.c=%.d)

CPPFLAGS += -D_GNU_SOURCE -D__USE_FILE_OFFSET64 -MD -MP \
	    -D"__printflike(fmtarg, firstvararg)=__attribute__((__format__ (__printf__, fmtarg, firstvararg)))" \
	    -D"__printf0like(fmtarg, firstvararg)=__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))"

ifndef NOPTHREADS
CFLAGS += -DUSE_PTHREADS=1 -pthread
endif

ifdef NOMD5
CFLAGS += -DNOMD5
else
CFLAGS += $(shell pkg-config --cflags libbsd-overlay)
LDLIBS += $(shell pkg-config --libs libbsd-overlay)
SRCS += md5.c
endif

all: cpdup

cpdup: $(OBJS)

clean:
	-rm -f $(OBJS) $(DEPS)

-include $(DEPS)