forked from azatoth/minidlna
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (65 loc) · 2.42 KB
/
Copy pathMakefile
File metadata and controls
81 lines (65 loc) · 2.42 KB
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
# $Id$
# MiniDLNA project
# http://sourceforge.net/projects/minidlna/
# (c) 2008-2009 Justin Maggard
# 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
STATIC=--static
CFLAGS = -Wall -g -O3 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
$(shell pkg-config libavformat libavutil libavcodec sqlite3 libexif id3tag flac ogg vorbis --cflags)
#STATIC_LINKING: CFLAGS += -DSTATIC
#STATIC_LINKING: LDFLAGS = -static
CC = gcc
RM = rm -f
INSTALL = install
DEPDIR = .deps
INSTALLPREFIX ?= $(DESTDIR)/usr
SBININSTALLDIR = $(INSTALLPREFIX)/sbin
ETCINSTALLDIR = $(DESTDIR)/etc
BASEOBJS = minidlna.o upnphttp.o upnpdescgen.o upnpsoap.o \
upnpreplyparse.o minixml.o \
getifaddr.o daemonize.o upnpglobalvars.o \
options.o minissdp.o uuid.o upnpevents.o \
sql.o utils.o metadata.o scanner.o inotify.o \
tivo_utils.o tivo_beacon.o tivo_commands.o \
tagutils/textutils.o tagutils/misc.o tagutils/tagutils.o \
playlist.o image_utils.o albumart.o log.o
ALLOBJS = $(BASEOBJS) $(LNXOBJS)
LIBS = -lpthread -ljpeg \
$(shell pkg-config libavformat libavutil libavcodec libexif sqlite3 id3tag flac ogg vorbis --libs)
#STATIC_LINKING: LIBS = -lvorbis -logg -lm -lsqlite3 -lpthread -lexif -ljpeg -lFLAC -lm -lid3tag -lz -lavformat -lavutil -lavcodec -lm
TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o
EXECUTABLES = minidlna testupnpdescgen
.PHONY: all clean distclean install
all: $(EXECUTABLES)
clean:
$(RM) $(ALLOBJS)
$(RM) $(EXECUTABLES)
$(RM) testupnpdescgen.o
$(RM) -r $(DEPDIR)
distclean: clean
$(RM) config.h
install: minidlna
$(INSTALL) -d $(SBININSTALLDIR)
$(INSTALL) minidlna $(SBININSTALLDIR)
$(INSTALL) -d $(ETCINSTALLDIR)
$(INSTALL) --mode=0644 minidlna.conf $(ETCINSTALLDIR)
minidlna: config.h $(BASEOBJS) $(LNXOBJS)
$(if $(findstring 1,$(V)),,@echo Linking $@;) $(CC) $(LDFLAGS) -o $@ $(BASEOBJS) $(LNXOBJS) $(LIBS)
testupnpdescgen: config.h $(TESTUPNPDESCGENOBJS)
$(if $(findstring 1,$(V)),,@echo Linking $@;) $(CC) $(LDFLAGS) -o $@ $(TESTUPNPDESCGENOBJS)
config.h: genconfig.sh
./genconfig.sh
%.o : %.c
@@mkdir -p $(dir $(DEPDIR)/$*.Tpo)
$(if $(findstring 1,$(V)),,@echo Compiling $@;) $(CC) -c $(CFLAGS) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -o $@ $<
@@mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-include $(SRCS:%.cpp=$(DEPDIR)/%.Po)