1 | # $Id: Makefile,v 1.31 2011/04/21 08:50:44 jmaggard Exp $ |
---|
2 | # MiniDLNA project |
---|
3 | # http://sourceforge.net/projects/minidlna/ |
---|
4 | # (c) 2008-2009 Justin Maggard |
---|
5 | # for use with GNU Make |
---|
6 | # To install use : |
---|
7 | # $ DESTDIR=/dummyinstalldir make install |
---|
8 | # or : |
---|
9 | # $ INSTALLPREFIX=/usr/local make install |
---|
10 | # or : |
---|
11 | # $ make install |
---|
12 | # |
---|
13 | #CFLAGS = -Wall -O -D_GNU_SOURCE -g -DDEBUG |
---|
14 | #CFLAGS = -Wall -g -Os -D_GNU_SOURCE |
---|
15 | CFLAGS = -Wall -g -O3 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ |
---|
16 | -I/usr/include/ffmpeg \ |
---|
17 | -I/usr/include/libavutil -I/usr/include/libavcodec -I/usr/include/libavformat \ |
---|
18 | -I/usr/include/ffmpeg/libavutil -I/usr/include/ffmpeg/libavcodec -I/usr/include/ffmpeg/libavformat |
---|
19 | #STATIC_LINKING: CFLAGS += -DSTATIC |
---|
20 | #STATIC_LINKING: LDFLAGS = -static |
---|
21 | CC = gcc |
---|
22 | RM = rm -f |
---|
23 | INSTALL = install |
---|
24 | |
---|
25 | INSTALLPREFIX ?= $(DESTDIR)/usr |
---|
26 | SBININSTALLDIR = $(INSTALLPREFIX)/sbin |
---|
27 | ETCINSTALLDIR = $(DESTDIR)/etc |
---|
28 | |
---|
29 | BASEOBJS = minidlna.o upnphttp.o upnpdescgen.o upnpsoap.o \ |
---|
30 | upnpreplyparse.o minixml.o \ |
---|
31 | getifaddr.o daemonize.o upnpglobalvars.o \ |
---|
32 | options.o minissdp.o uuid.o upnpevents.o \ |
---|
33 | sql.o utils.o metadata.o scanner.o inotify.o \ |
---|
34 | tivo_utils.o tivo_beacon.o tivo_commands.o \ |
---|
35 | tagutils/textutils.o tagutils/misc.o tagutils/tagutils.o \ |
---|
36 | playlist.o image_utils.o albumart.o log.o |
---|
37 | |
---|
38 | ALLOBJS = $(BASEOBJS) $(LNXOBJS) |
---|
39 | |
---|
40 | LIBS = -lpthread -lexif -ljpeg -lsqlite3 -lavformat -lavutil -lavcodec -lid3tag -lFLAC -logg -lvorbis |
---|
41 | #STATIC_LINKING: LIBS = -lvorbis -logg -lm -lsqlite3 -lpthread -lexif -ljpeg -lFLAC -lm -lid3tag -lz -lavformat -lavutil -lavcodec -lm |
---|
42 | |
---|
43 | TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o |
---|
44 | |
---|
45 | EXECUTABLES = minidlna testupnpdescgen |
---|
46 | |
---|
47 | .PHONY: all clean distclean install depend |
---|
48 | |
---|
49 | all: $(EXECUTABLES) |
---|
50 | |
---|
51 | clean: |
---|
52 | $(RM) $(ALLOBJS) |
---|
53 | $(RM) $(EXECUTABLES) |
---|
54 | $(RM) testupnpdescgen.o |
---|
55 | |
---|
56 | distclean: clean |
---|
57 | $(RM) config.h |
---|
58 | |
---|
59 | install: minidlna |
---|
60 | $(INSTALL) -d $(SBININSTALLDIR) |
---|
61 | $(INSTALL) minidlna $(SBININSTALLDIR) |
---|
62 | $(INSTALL) -d $(ETCINSTALLDIR) |
---|
63 | $(INSTALL) --mode=0644 minidlna.conf $(ETCINSTALLDIR) |
---|
64 | |
---|
65 | minidlna: $(BASEOBJS) $(LNXOBJS) $(LIBS) |
---|
66 | @echo Linking $@ |
---|
67 | @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS) |
---|
68 | |
---|
69 | |
---|
70 | testupnpdescgen: $(TESTUPNPDESCGENOBJS) |
---|
71 | @echo Linking $@ |
---|
72 | @$(CC) $(CFLAGS) -o $@ $(TESTUPNPDESCGENOBJS) |
---|
73 | |
---|
74 | config.h: genconfig.sh |
---|
75 | ./genconfig.sh |
---|
76 | |
---|
77 | depend: config.h |
---|
78 | makedepend -f$(MAKEFILE_LIST) -Y \ |
---|
79 | $(ALLOBJS:.o=.c) $(TESTUPNPDESCGENOBJS:.o=.c) 2>/dev/null |
---|
80 | |
---|
81 | # DO NOT DELETE |
---|
82 | |
---|
83 | minidlna.o: config.h upnpglobalvars.h minidlnatypes.h |
---|
84 | minidlna.o: upnphttp.h upnpdescgen.h minidlnapath.h getifaddr.h upnpsoap.h |
---|
85 | minidlna.o: options.h minissdp.h daemonize.h upnpevents.h log.h |
---|
86 | upnphttp.o: config.h upnphttp.h upnpdescgen.h minidlnapath.h upnpsoap.h |
---|
87 | upnphttp.o: upnpevents.h image_utils.h sql.h log.h icons.c |
---|
88 | upnpdescgen.o: config.h upnpdescgen.h minidlnapath.h upnpglobalvars.h |
---|
89 | upnpdescgen.o: minidlnatypes.h upnpdescstrings.h log.h |
---|
90 | upnpsoap.o: config.h upnpglobalvars.h minidlnatypes.h log.h utils.h sql.h |
---|
91 | upnpsoap.o: upnphttp.h upnpsoap.h upnpreplyparse.h getifaddr.h log.h |
---|
92 | upnpreplyparse.o: upnpreplyparse.h minixml.h log.h |
---|
93 | minixml.o: minixml.h |
---|
94 | getifaddr.o: getifaddr.h log.h |
---|
95 | daemonize.o: daemonize.h config.h log.h |
---|
96 | upnpglobalvars.o: config.h upnpglobalvars.h |
---|
97 | upnpglobalvars.o: minidlnatypes.h |
---|
98 | options.o: options.h config.h upnpglobalvars.h |
---|
99 | options.o: minidlnatypes.h |
---|
100 | minissdp.o: config.h upnpdescstrings.h minidlnapath.h upnphttp.h |
---|
101 | minissdp.o: upnpglobalvars.h minidlnatypes.h minissdp.h log.h |
---|
102 | upnpevents.o: config.h upnpevents.h minidlnapath.h upnpglobalvars.h |
---|
103 | upnpevents.o: minidlnatypes.h upnpdescgen.h log.h uuid.h |
---|
104 | uuid.o: uuid.h |
---|
105 | testupnpdescgen.o: config.h upnpdescgen.h |
---|
106 | upnpdescgen.o: config.h upnpdescgen.h minidlnapath.h upnpglobalvars.h |
---|
107 | upnpdescgen.o: minidlnatypes.h upnpdescstrings.h |
---|
108 | scanner.o: upnpglobalvars.h metadata.h utils.h sql.h scanner.h log.h playlist.h |
---|
109 | metadata.o: upnpglobalvars.h metadata.h albumart.h utils.h sql.h log.h |
---|
110 | albumart.o: upnpglobalvars.h albumart.h utils.h image_utils.h sql.h log.h |
---|
111 | tagutils/misc.o: tagutils/misc.h |
---|
112 | tagutils/textutils.o: tagutils/misc.h tagutils/textutils.h log.h |
---|
113 | tagutils/tagutils.o: tagutils/tagutils-asf.c tagutils/tagutils-flc.c tagutils/tagutils-plist.c tagutils/tagutils-misc.c |
---|
114 | tagutils/tagutils.o: tagutils/tagutils-aac.c tagutils/tagutils-asf.h tagutils/tagutils-flc.h tagutils/tagutils-mp3.c tagutils/tagutils-wav.c |
---|
115 | tagutils/tagutils.o: tagutils/tagutils-ogg.c tagutils/tagutils-aac.h tagutils/tagutils.h tagutils/tagutils-mp3.h tagutils/tagutils-ogg.h log.h |
---|
116 | playlist.o: playlist.h |
---|
117 | inotify.o: inotify.h playlist.h |
---|
118 | image_utils.o: image_utils.h |
---|
119 | tivo_utils.o: config.h tivo_utils.h |
---|
120 | tivo_beacon.o: config.h tivo_beacon.h tivo_utils.h |
---|
121 | tivo_commands.o: config.h tivo_commands.h tivo_utils.h utils.h |
---|
122 | utils.o: utils.h |
---|
123 | sql.o: sql.h |
---|
124 | log.o: log.h |
---|
125 | |
---|
126 | .SUFFIXES: .c .o |
---|
127 | |
---|
128 | .c.o: |
---|
129 | @echo Compiling $*.c |
---|
130 | @$(CC) $(CFLAGS) -o $@ -c $< && exit 0;\ |
---|
131 | echo "The following command failed:" 1>&2;\ |
---|
132 | echo "$(CC) $(CFLAGS) -o $@ -c $<";\ |
---|
133 | $(CC) $(CFLAGS) -o $@ -c $< &>/dev/null |
---|