-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
executable file
·44 lines (32 loc) · 928 Bytes
/
Makefile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/make -f
.PHONY: clean all
all:
PROGRAM = main
OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
DEPS = $(OBJS:%.o=%.d)
CLEAN = $(PROGRAM) $(OBJS) $(DEPS)
LDLIBS = -levent -lssl -lldap -llber -levent_openssl -lcrypto -lconfig
CFLAGS = -g -Wall
ifdef LIBEVENT_PATH
# libevent 2.1 is still in alpha, so let's set up rpath even though we should not
LDFLAGS += -L $(LIBEVENT_PATH)/lib -Wl,--enable-new-dtags,--rpath=$(LIBEVENT_PATH)/lib
CPPFLAGS += -I $(LIBEVENT_PATH)/include
endif
%.d: %.c
$(CC) -MM -MF $@ -MT $@ -MT $*.o $<
d :=
sp :=
dir := avl
include $(dir)/Rules.mk
all: $(PROGRAM)
$(PROGRAM):
main: $(OBJS)
clean:
rm -rf $(CLEAN) core
# so that cleaning does not trigger remaking the dependency information
#
# note that there might be other targets that do not need this information, but
# this only considers the "clean" target
ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
-include $(DEPS)
endif