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/home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/tufsbox/devkit/sh4/usr/include \ |
---|
17 | -I/home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/cvs/cdk/ffmpeg-0.6.3 \ |
---|
18 | -I/home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/cvs/cdk/ffmpeg-0.6.3/libavutil -I/home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/cvs/cdk/ffmpeg-0.6.3/libavcodec -I/home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/cvs/cdk/ffmpeg-0.6.3/libavformat \ |
---|
19 | -I/home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/tufsbox/devkit/sh4/usr/include -L/home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/tufsbox/devkit/sh4/usr/lib |
---|
20 | #STATIC_LINKING: CFLAGS += -DSTATIC |
---|
21 | #STATIC_LINKING: LDFLAGS = -static |
---|
22 | LDFLAGS = -L/home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/tufsbox/devkit/sh4/usr/lib |
---|
23 | CC = /home/gost4711/disc2/flashimg/BUILDGIT/checkout_stm23/tdt/tufsbox/devkit/sh4/bin/sh4-linux-gcc |
---|
24 | RM = rm -f |
---|
25 | INSTALL = install |
---|
26 | |
---|
27 | INSTALLPREFIX ?= $(DESTDIR)/usr |
---|
28 | SBININSTALLDIR = $(INSTALLPREFIX)/sbin |
---|
29 | ETCINSTALLDIR = $(DESTDIR)/etc |
---|
30 | |
---|
31 | BASEOBJS = minidlna.o upnphttp.o upnpdescgen.o upnpsoap.o \ |
---|
32 | upnpreplyparse.o minixml.o \ |
---|
33 | getifaddr.o daemonize.o upnpglobalvars.o \ |
---|
34 | options.o minissdp.o uuid.o upnpevents.o \ |
---|
35 | sql.o utils.o metadata.o scanner.o inotify.o \ |
---|
36 | tivo_utils.o tivo_beacon.o tivo_commands.o \ |
---|
37 | tagutils/textutils.o tagutils/misc.o tagutils/tagutils.o \ |
---|
38 | playlist.o image_utils.o albumart.o log.o |
---|
39 | |
---|
40 | ALLOBJS = $(BASEOBJS) $(LNXOBJS) |
---|
41 | |
---|
42 | LIBS = -lpthread -lexif -ljpeg -lsqlite3 -lavformat -lavutil -lavcodec -lid3tag -lFLAC -logg -lvorbis |
---|
43 | #STATIC_LINKING: LIBS = -lvorbis -logg -lm -lsqlite3 -lpthread -lexif -ljpeg -lFLAC -lm -lid3tag -lz -lavformat -lavutil -lavcodec -lm |
---|
44 | |
---|
45 | TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o |
---|
46 | |
---|
47 | EXECUTABLES = minidlna testupnpdescgen |
---|
48 | |
---|
49 | .PHONY: all clean distclean install depend |
---|
50 | |
---|
51 | all: $(EXECUTABLES) |
---|
52 | |
---|
53 | clean: |
---|
54 | $(RM) $(ALLOBJS) |
---|
55 | $(RM) $(EXECUTABLES) |
---|
56 | $(RM) testupnpdescgen.o |
---|
57 | |
---|
58 | distclean: clean |
---|
59 | $(RM) config.h |
---|
60 | |
---|
61 | install: minidlna |
---|
62 | $(INSTALL) -d $(SBININSTALLDIR) |
---|
63 | $(INSTALL) minidlna $(SBININSTALLDIR) |
---|
64 | $(INSTALL) -d $(ETCINSTALLDIR) |
---|
65 | $(INSTALL) --mode=0644 minidlna.conf $(ETCINSTALLDIR) |
---|
66 | |
---|
67 | minidlna: $(BASEOBJS) $(LNXOBJS) |
---|
68 | @echo Linking $@ |
---|
69 | @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS) |
---|
70 | |
---|
71 | |
---|
72 | testupnpdescgen: $(TESTUPNPDESCGENOBJS) |
---|
73 | @echo Linking $@ |
---|
74 | @$(CC) $(CFLAGS) -o $@ $(TESTUPNPDESCGENOBJS) |
---|
75 | |
---|
76 | config.h: genconfig.sh |
---|
77 | ./genconfig.sh |
---|
78 | |
---|
79 | depend: config.h |
---|
80 | makedepend -f$(MAKEFILE_LIST) -Y \ |
---|
81 | $(ALLOBJS:.o=.c) $(TESTUPNPDESCGENOBJS:.o=.c) 2>/dev/null |
---|
82 | |
---|
83 | # DO NOT DELETE |
---|
84 | |
---|
85 | minidlna.o: config.h upnpglobalvars.h minidlnatypes.h |
---|
86 | minidlna.o: upnphttp.h upnpdescgen.h minidlnapath.h getifaddr.h upnpsoap.h |
---|
87 | minidlna.o: options.h minissdp.h daemonize.h upnpevents.h log.h |
---|
88 | upnphttp.o: config.h upnphttp.h upnpdescgen.h minidlnapath.h upnpsoap.h |
---|
89 | upnphttp.o: upnpevents.h image_utils.h sql.h log.h icons.c |
---|
90 | upnpdescgen.o: config.h upnpdescgen.h minidlnapath.h upnpglobalvars.h |
---|
91 | upnpdescgen.o: minidlnatypes.h upnpdescstrings.h log.h |
---|
92 | upnpsoap.o: config.h upnpglobalvars.h minidlnatypes.h log.h utils.h sql.h |
---|
93 | upnpsoap.o: upnphttp.h upnpsoap.h upnpreplyparse.h getifaddr.h log.h |
---|
94 | upnpreplyparse.o: upnpreplyparse.h minixml.h log.h |
---|
95 | minixml.o: minixml.h |
---|
96 | getifaddr.o: getifaddr.h log.h |
---|
97 | daemonize.o: daemonize.h config.h log.h |
---|
98 | upnpglobalvars.o: config.h upnpglobalvars.h |
---|
99 | upnpglobalvars.o: minidlnatypes.h |
---|
100 | options.o: options.h config.h upnpglobalvars.h |
---|
101 | options.o: minidlnatypes.h |
---|
102 | minissdp.o: config.h upnpdescstrings.h minidlnapath.h upnphttp.h |
---|
103 | minissdp.o: upnpglobalvars.h minidlnatypes.h minissdp.h log.h |
---|
104 | upnpevents.o: config.h upnpevents.h minidlnapath.h upnpglobalvars.h |
---|
105 | upnpevents.o: minidlnatypes.h upnpdescgen.h log.h uuid.h |
---|
106 | uuid.o: uuid.h |
---|
107 | testupnpdescgen.o: config.h upnpdescgen.h |
---|
108 | upnpdescgen.o: config.h upnpdescgen.h minidlnapath.h upnpglobalvars.h |
---|
109 | upnpdescgen.o: minidlnatypes.h upnpdescstrings.h |
---|
110 | scanner.o: upnpglobalvars.h metadata.h utils.h sql.h scanner.h log.h playlist.h |
---|
111 | metadata.o: upnpglobalvars.h metadata.h albumart.h utils.h sql.h log.h |
---|
112 | albumart.o: upnpglobalvars.h albumart.h utils.h image_utils.h sql.h log.h |
---|
113 | tagutils/misc.o: tagutils/misc.h |
---|
114 | tagutils/textutils.o: tagutils/misc.h tagutils/textutils.h log.h |
---|
115 | tagutils/tagutils.o: tagutils/tagutils-asf.c tagutils/tagutils-flc.c tagutils/tagutils-plist.c tagutils/tagutils-misc.c |
---|
116 | tagutils/tagutils.o: tagutils/tagutils-aac.c tagutils/tagutils-asf.h tagutils/tagutils-flc.h tagutils/tagutils-mp3.c tagutils/tagutils-wav.c |
---|
117 | tagutils/tagutils.o: tagutils/tagutils-ogg.c tagutils/tagutils-aac.h tagutils/tagutils.h tagutils/tagutils-mp3.h tagutils/tagutils-ogg.h log.h |
---|
118 | playlist.o: playlist.h |
---|
119 | inotify.o: inotify.h playlist.h |
---|
120 | image_utils.o: image_utils.h |
---|
121 | tivo_utils.o: config.h tivo_utils.h |
---|
122 | tivo_beacon.o: config.h tivo_beacon.h tivo_utils.h |
---|
123 | tivo_commands.o: config.h tivo_commands.h tivo_utils.h utils.h |
---|
124 | utils.o: utils.h |
---|
125 | sql.o: sql.h |
---|
126 | log.o: log.h |
---|
127 | |
---|
128 | .SUFFIXES: .c .o |
---|
129 | |
---|
130 | .c.o: |
---|
131 | @echo Compiling $*.c |
---|
132 | @$(CC) $(CFLAGS) -o $@ -c $< && exit 0;\ |
---|
133 | echo "The following command failed:" 1>&2;\ |
---|
134 | echo "$(CC) $(CFLAGS) -o $@ -c $<";\ |
---|
135 | $(CC) $(CFLAGS) -o $@ -c $< &>/dev/null |
---|