OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / linux-igd / Makefile
1 PREFIX=/usr
2 LIBUPNP_PREFIX=/usr
3 #LIBIPTC_PREFIX=/usr
4
5 LIBS= $(LIBUPNP) $(LIBIXML) $(LIBTHREADUTIL) -lpthread
6 FILES= main.o gatedevice.o pmlist.o util.o config.o
7 CFLAGS += -Wall
8
9 ifdef HAVE_LIBIPTC
10 ifdef LIBIPTC_PREFIX
11 LIBS += -L$(LIBIPTC_PREFIX)/lib
12 INCLUDES += -I$(LIBIPTC_PREFIX)/include
13 endif
14
15 LIBS += -liptc
16 INCLUDES += -DHAVE_LIBIPTC
17 FILES += iptc.o
18 endif
19
20 ifdef CONFIG_USER_FLATFSD_FLATFSD
21 CFLAGS += -DCONF_FILE='"/etc/config/upnpd.conf"'
22 endif
23
24 all: upnpd
25
26 upnpd: $(FILES)
27         $(CC) $(CFLAGS) $(LDFLAGS) $(FILES) $(LIBS) -o $@ $(LDLIBS)
28 ifndef CONFIG_USER_LINUXIGD_DEFAULT
29         cat etc/gatedesc.snapgear.in | sed -e 's/DEVICENAME\.IN/$(CONFIG_PRODUCT)/' > etc/gatedesc.snapgear
30 endif
31         @echo "make $@ finished on `date`"
32
33 %.o:    %.c
34         $(CC) $(CFLAGS) $(INCLUDES) -c $<
35
36 clean:
37         rm -f *.o upnpd
38         rm -f etc/gatedesc.snapgear
39
40 install: upnpd
41         install -d /etc/linuxigd
42         install etc/gatedesc.xml /etc/linuxigd
43         install etc/gateconnSCPD.xml  /etc/linuxigd
44         install etc/gateicfgSCPD.xml /etc/linuxigd
45         install etc/dummy.xml /etc/linuxigd
46         install upnpd $(PREFIX)/sbin
47         install upnpd.8 $(PREFIX)/share/man/man8
48         if [ ! -f /etc/upnpd.conf ]; then install etc/upnpd.conf /etc; fi
49
50 romfs:
51 ifdef CONFIG_USER_LINUXIGD_LINUXIGD
52         $(ROMFSINST) upnpd /bin/upnpd
53         @if [ ! -d $(ROMFSDIR)/etc/linuxigd ]; then mkdir $(ROMFSDIR)/etc/linuxigd; fi
54         $(ROMFSINST) etc/gateconnSCPD.xml /etc/linuxigd/gateconnSCPD.xml
55         $(ROMFSINST) etc/gateicfgSCPD.xml /etc/linuxigd/gateicfgSCPD.xml
56         $(ROMFSINST) etc/ligd.gif /etc/linuxigd/ligd.gif
57         $(ROMFSINST) etc/dummy.xml /etc/linuxigd/dummy.xml
58 ifndef CONFIG_USER_LINUXIGD_DEFAULT
59         $(ROMFSINST) etc/gatedesc.snapgear /etc/linuxigd/gatedesc.xml
60 else
61         $(ROMFSINST) etc/gatedesc.xml /etc/linuxigd/gatedevice.xml
62         $(ROMFSINST) etc/upnpd.conf /etc/default/upnpd.conf
63 endif
64 endif