-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathMakefile
36 lines (24 loc) · 779 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
prefix = /usr/local
CFLAGS ?= -g -O2
INSTALL ?= install
PKG_CONFIG ?= pkg-config
ifeq ($(shell $(PKG_CONFIG) --exists libsystemd || echo NO),)
DEFS += -DHAVE_SYSTEMD_SD_DAEMON_H $(shell $(PKG_CONFIG) --cflags libsystemd)
LDADD += $(shell $(PKG_CONFIG) --libs libsystemd)
endif
CPPFLAGS += $(DEFS) $(INCLUDES)
OBJECTS := log.o network.o utils.o udptunnel.o
all: depend udptunnel
install:
$(INSTALL) -d $(BASEDIR)$(prefix)/sbin/
$(INSTALL) -m 0755 udptunnel $(BASEDIR)$(prefix)/sbin/
clean:
rm -f Makefile.depend $(OBJECTS) udptunnel
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
udptunnel: $(OBJECTS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDADD) $(LIBS)
depend: Makefile.depend
Makefile.depend:
$(CC) $(CPPFLAGS) $(CFLAGS) -MM -MG *.c > $@
-include Makefile.depend