-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
94 lines (78 loc) · 2.61 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# $Id: Makefile,v 1.31 2011/04/21 08:50:44 jmaggard Exp $
# DLNAProxy project
# (c) 2011 Lukas Prettenthaler
# for use with GNU Make
# To install use :
# $ DESTDIR=/dummyinstalldir make install
# or :
# $ INSTALLPREFIX=/usr/local make install
# or :
# $ make install
#
#CFLAGS = -Wall -O -D_GNU_SOURCE -g -DDEBUG
#CFLAGS = -Wall -g -Os -D_GNU_SOURCE
CFLAGS = -Wall -g -O3 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
#STATIC_LINKING: CFLAGS += -DSTATIC
#STATIC_LINKING: LDFLAGS = -static
CC = gcc
RM = rm -f
INSTALL = install
INSTALLPREFIX ?= $(DESTDIR)/usr
SBININSTALLDIR = $(INSTALLPREFIX)/sbin
ETCINSTALLDIR = $(DESTDIR)/etc
BASEOBJS = dlnaproxy.o upnpdescgen.o utils.o \
upnpreplyparse.o minixml.o \
getifaddr.o daemonize.o upnpglobalvars.o \
options.o minissdp.o uuid.o upnpevents.o \
tcptunnel.o log.o
ALLOBJS = $(BASEOBJS) $(LNXOBJS)
#LIBS = -lpthread
#STATIC_LINKING: LIBS = -lm -lpthread -lz
EXECUTABLES = dlnaproxy
.PHONY: all clean distclean install depend
all: $(EXECUTABLES)
clean:
$(RM) $(ALLOBJS)
$(RM) $(EXECUTABLES)
distclean: clean
install: dlnaproxy
$(INSTALL) -d $(SBININSTALLDIR)
$(INSTALL) dlnaproxy $(SBININSTALLDIR)
$(INSTALL) -d $(ETCINSTALLDIR)
$(INSTALL) --mode=0644 dlnaproxy.conf $(ETCINSTALLDIR)
dlnaproxy: $(BASEOBJS) $(LNXOBJS) $(LIBS)
@echo Linking $@
@$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS)
depend: makedepend -f$(MAKEFILE_LIST) -Y \
$(ALLOBJS:.o=.c) 2>/dev/null
# DO NOT DELETE
dlnaproxy.o: config.h upnpglobalvars.h dlnaproxytypes.h tcptunnel.h
dlnaproxy.o: upnpdescgen.h getifaddr.h
dlnaproxy.o: options.h minissdp.h daemonize.h upnpevents.h log.h
upnpdescgen.o: config.h upnpdescgen.h upnpglobalvars.h
upnpdescgen.o: dlnaproxytypes.h upnpdescstrings.h log.h
upnpreplyparse.o: upnpreplyparse.h minixml.h log.h
minixml.o: minixml.h
getifaddr.o: getifaddr.h log.h
daemonize.o: daemonize.h config.h log.h
upnpglobalvars.o: config.h upnpglobalvars.h
upnpglobalvars.o: dlnaproxytypes.h
options.o: options.h config.h upnpglobalvars.h
options.o: dlnaproxytypes.h
minissdp.o: config.h upnpdescstrings.h
minissdp.o: upnpglobalvars.h dlnaproxytypes.h minissdp.h log.h
upnpevents.o: config.h upnpevents.h upnpglobalvars.h
upnpevents.o: dlnaproxytypes.h upnpdescgen.h log.h uuid.h
uuid.o: uuid.h
upnpdescgen.o: config.h upnpdescgen.h upnpglobalvars.h
upnpdescgen.o: dlnaproxytypes.h upnpdescstrings.h
utils.o: utils.h
tcptunnel.o: log.h
log.o: log.h
.SUFFIXES: .c .o
.c.o:
@echo Compiling $*.c
@$(CC) $(CFLAGS) -o $@ -c $< && exit 0;\
echo "The following command failed:" 1>&2;\
echo "$(CC) $(CFLAGS) -o $@ -c $<";\
$(CC) $(CFLAGS) -o $@ -c $< &>/dev/null