more advanced Nginx settings in GUI
[tomato.git] / release / src-rt-6.x.4708 / router / rc / Makefile
blobcc518c6d191639f9b7b56469459227391540e990
1 include ../common.mak
3 CFLAGS = -Wall -Os $(EXTRACFLAGS)
4 CFLAGS += -I. -I$(TOP)/shared -I$(SRCBASE)/include -idirafter$(LINUXDIR)/include
5 CFLAGS += -ffunction-sections -fdata-sections
8 ifeq ($(TCONFIG_BCMARM),y)
9 LDFLAGS = -L$(TOP)/nvram${BCMEX} -lnvram -L$(TOP)/shared -lshared -lcrypt -L$(TOP)/libbcmcrypto -lbcmcrypto
10 CFLAGS += -I$(SRCBASE)/shared/bcmwifi/include -DHAVE_TYPE_FLOAT
11 CFLAGS += -I$(SRCBASE)/common/include
12 LDFLAGS += -L$(TOP)/libbcm -lbcm
13 LDFLAGS += -lgcc_s
14 else
15 LDFLAGS = -L$(TOP)/nvram -lnvram -L$(TOP)/shared -lshared -lcrypt
16 endif
18 LDFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections
19 ifeq ($(STATIC),1)
20 LDFLAGS += -static
21 endif
23 LDFLAGS += $(EXTRA_LDFLAGS)
25 ifeq ($(TCONFIG_BCMSMP),y)
26 CFLAGS += -DSMP
27 endif
29 OBJS := rc.o init.o interface.o network.o wan.o services.o dhcp.o
30 OBJS += firewall.o ppp.o telssh.o wnas.o
31 OBJS += listen.o redial.o led.o qos.o forward.o misc.o mtd.o
32 OBJS += buttons.o restrict.o gpio.o sched.o
33 OBJS += new_qoslimit.o arpbind.o
34 OBJS += tomatoanon.o
36 ifeq ($(TCONFIG_BCMARM),y)
37 OBJS += bcmutils.o
38 endif
40 #ifeq ($(CONFIG_BCMWL6),y)
41 OBJS += blink_5g.o
42 #endif
44 ifeq ($(TCONFIG_USB),y)
45 OBJS += usb.o
46 endif
47 ifeq ($(TCONFIG_DDNS),y)
48 OBJS += ddns.o
49 endif
50 ifeq ($(TCONFIG_CIFS),y)
51 OBJS += cifs.o
52 endif
53 ifeq ($(TCONFIG_JFFS2),y)
54 OBJS += jffs2.o
55 endif
56 ifeq ($(TCONFIG_OPENVPN),y)
57 OBJS += vpn.o
58 endif
59 ifeq ($(TCONFIG_TINC),y)
60 OBJS += tinc.o
61 endif
62 ifeq ($(TCONFIG_PPTPD),y)
63 OBJS += pptpd.o
64 OBJS += pptp_client.o
65 endif
67 ifeq ($(TCONFIG_NOCAT),y)
68 OBJS += nocat.o
69 endif
71 ifeq ($(TCONFIG_NGINX),y)
72 OBJS += nginx.o
73 endif
75 ifeq ($(TOMATO_SL),1)
76 #OBJS += usb.o
77 OBJS += samba.o
78 endif
80 ifeq ($(TCONFIG_BT),y)
81 OBJS += transmission.o
82 endif
84 ifeq ($(TCONFIG_NFS),y)
85 OBJS += nfs.o
86 endif
88 ifeq ($(TCONFIG_SNMP),y)
89 OBJS += snmp.o
90 endif
92 ifeq ($(TCONFIG_SDHC),y)
93 OBJS += mmc.o
94 endif
96 ifeq ($(TCONFIG_UPS),y)
97 OBJS += ups.o
98 endif
100 ifeq ($(TCONFIG_TOR),y)
101 OBJS += tor.o
102 endif
104 ifeq ($(TCONFIG_BCMARM),y)
105 vpath %.c $(SRCBASE)/shared
106 endif
108 all: rc
110 rc: $(OBJS)
111 @echo " [rc] CC $@"
112 @$(CC) -o $@ $^ $(LDFLAGS)
114 $(SIZECHECK)
115 $(CPTMP)
117 install: all
118 @echo "[rc] Installing..."
119 @install -D rc $(INSTALLDIR)/sbin/rc
120 @$(STRIP) $(INSTALLDIR)/sbin/rc
121 @chmod 0500 $(INSTALLDIR)/sbin/rc
123 ifeq ($(TCONFIG_BCMARM),y)
124 @cd $(INSTALLDIR)/sbin && ln -sf rc preinit
125 else
126 @cd $(INSTALLDIR)/sbin && ln -sf rc init
127 endif
128 @cd $(INSTALLDIR)/sbin && ln -sf rc console
129 @cd $(INSTALLDIR)/sbin && ln -sf rc hotplug
130 @cd $(INSTALLDIR)/sbin && ln -sf rc service
131 @cd $(INSTALLDIR)/sbin && ln -sf rc buttons
132 @cd $(INSTALLDIR)/sbin && ln -sf rc blink_5g
133 @cd $(INSTALLDIR)/sbin && ln -sf rc rcheck
134 @cd $(INSTALLDIR)/sbin && ln -sf rc radio
135 @cd $(INSTALLDIR)/sbin && ln -sf rc led
136 @cd $(INSTALLDIR)/sbin && ln -sf rc reboot
137 @cd $(INSTALLDIR)/sbin && ln -sf rc halt
138 @cd $(INSTALLDIR)/sbin && ln -sf rc redial
139 @cd $(INSTALLDIR)/sbin && ln -sf rc gpio
140 @cd $(INSTALLDIR)/sbin && ln -sf rc sched
142 @cd $(INSTALLDIR)/sbin && ln -sf rc disconnected_pppoe
143 @cd $(INSTALLDIR)/sbin && ln -sf rc listen
144 @cd $(INSTALLDIR)/sbin && ln -sf rc ppp_event
146 ifeq ($(TCONFIG_BCMARM),y)
147 @cd $(INSTALLDIR)/sbin && ln -sf rc mtd-write2
148 @cd $(INSTALLDIR)/sbin && ln -sf rc mtd-erase2
149 @cd $(INSTALLDIR)/sbin && ln -sf rc nvram_erase
150 else
151 @cd $(INSTALLDIR)/sbin && ln -sf rc mtd-write
152 @cd $(INSTALLDIR)/sbin && ln -sf rc mtd-erase
153 endif
154 @cd $(INSTALLDIR)/sbin && ln -sf rc mtd-unlock
156 @cd $(INSTALLDIR)/sbin && ln -sf rc dhcpc-event
157 @cd $(INSTALLDIR)/sbin && ln -sf rc dhcpc-release
158 @cd $(INSTALLDIR)/sbin && ln -sf rc dhcpc-renew
160 @cd $(INSTALLDIR)/sbin && ln -sf rc wldist
162 ifeq ($(TCONFIG_IPV6),y)
163 @cd $(INSTALLDIR)/sbin && ln -sf rc dhcp6c-state
164 endif
166 ifeq ($(TCONFIG_DDNS),y)
167 @cd $(INSTALLDIR)/sbin && ln -sf rc ddns-update
168 endif
170 ifeq ($(TCONFIG_CIFS),y)
171 @cd $(INSTALLDIR)/sbin && ln -sf rc mount-cifs
172 endif
174 ifeq ($(TOMATO_SL),1)
175 @cd $(INSTALLDIR)/sbin && ln -sf rc usbevent
176 @cd $(INSTALLDIR)/sbin && ln -sf rc usbrescan
177 @cd $(INSTALLDIR)/sbin && ln -sf rc hotdiskadd
178 @cd $(INSTALLDIR)/sbin && ln -sf rc hotdiskremove
179 @cd $(INSTALLDIR)/sbin && ln -sf rc hotdiskerror
180 @cd $(INSTALLDIR)/sbin && ln -sf rc umountx
181 endif
183 ifeq ($(TCONFIG_OPENVPN),y)
184 @mkdir -p $(INSTALLDIR)/rom/openvpn
185 @cp openvpn-updown.sh $(INSTALLDIR)/rom/openvpn/updown.sh
186 @chmod 0755 $(INSTALLDIR)/rom/openvpn/updown.sh
187 endif
189 clean:
190 rm -f rc *.o .*.depend
192 size: rc
193 mipsel-uclibc-nm --print-size --size-sort rc
195 %.o: %.c .%.depend
196 @echo " [rc] CC $@"
197 @$(CC) $(CFLAGS) -c $<
199 .%.depend: %.c
200 @$(CC) $(CFLAGS) -M $< > $@
202 -include $(OBJS:%.o=.%.depend)
206 pswatch: pswatch.c
207 $(CC) -o $@ $^
208 $(STRIP) $@
209 $(CPTMP)