BW Limiter: Restore BW limiter broken.
[tomato.git] / release / src / router / rc / Makefile
blobae92acfd062cd23aba88439ef439f7a18f285cbd
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
7 LDFLAGS = -L$(TOP)/nvram -lnvram -L$(TOP)/shared -lshared -lcrypt
8 LDFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections
9 ifeq ($(STATIC),1)
10 LDFLAGS += -static
11 endif
13 OBJS := rc.o init.o interface.o network.o wan.o services.o dhcp.o
14 OBJS += firewall.o ppp.o telssh.o wnas.o
15 OBJS += listen.o redial.o led.o qos.o forward.o misc.o mtd.o
16 OBJS += buttons.o restrict.o gpio.o sched.o
17 OBJS += arpbind.o
18 OBJS += new_qoslimit.o
19 OBJS += blink_5g.o
21 ifeq ($(TCONFIG_USB),y)
22 OBJS += usb.o
23 endif
24 ifeq ($(TCONFIG_DDNS),y)
25 OBJS += ddns.o
26 endif
27 ifeq ($(TCONFIG_CIFS),y)
28 OBJS += cifs.o
29 endif
30 ifeq ($(TCONFIG_JFFS2),y)
31 OBJS += jffs2.o
32 endif
33 ifeq ($(TCONFIG_OPENVPN),y)
34 OBJS += vpn.o
35 endif
36 ifeq ($(TCONFIG_NOCAT),y)
37 OBJS += nocat.o
38 endif
39 ifeq ($(TCONFIG_PPTPD),y)
40 OBJS += pptpd.o
41 endif
42 ifeq ($(TCONFIG_NGINX),y)
43 OBJS += nginx.o
44 endif
46 ifeq ($(TOMATO_SL),1)
47 #OBJS += usb.o
48 OBJS += samba.o
49 endif
51 ifeq ($(TCONFIG_SNMP),y)
52 OBJS += snmp.o
53 endif
55 ifeq ($(TCONFIG_USERPPTP),y)
56 OBJS += pptp_client.o
57 endif
59 all: rc
61 rc: $(OBJS)
62 @echo " [rc] CC $@"
63 @$(CC) -o $@ $^ $(LDFLAGS)
65 $(SIZECHECK)
66 $(CPTMP)
68 install: all
69 @echo "[rc] Installing..."
70 @install -D rc $(INSTALLDIR)/sbin/rc
71 @$(STRIP) $(INSTALLDIR)/sbin/rc
72 @chmod 0500 $(INSTALLDIR)/sbin/rc
74 @cd $(INSTALLDIR)/sbin && ln -sf rc init
75 @cd $(INSTALLDIR)/sbin && ln -sf rc console
76 @cd $(INSTALLDIR)/sbin && ln -sf rc hotplug
77 @cd $(INSTALLDIR)/sbin && ln -sf rc service
78 @cd $(INSTALLDIR)/sbin && ln -sf rc buttons
79 @cd $(INSTALLDIR)/sbin && ln -sf rc blink_5g
80 @cd $(INSTALLDIR)/sbin && ln -sf rc rcheck
81 @cd $(INSTALLDIR)/sbin && ln -sf rc radio
82 @cd $(INSTALLDIR)/sbin && ln -sf rc led
83 @cd $(INSTALLDIR)/sbin && ln -sf rc reboot
84 @cd $(INSTALLDIR)/sbin && ln -sf rc halt
85 @cd $(INSTALLDIR)/sbin && ln -sf rc redial
86 @cd $(INSTALLDIR)/sbin && ln -sf rc gpio
87 @cd $(INSTALLDIR)/sbin && ln -sf rc sched
89 @cd $(INSTALLDIR)/sbin && ln -sf rc disconnected_pppoe
90 @cd $(INSTALLDIR)/sbin && ln -sf rc listen
91 @cd $(INSTALLDIR)/sbin && ln -sf rc ppp_event
93 @cd $(INSTALLDIR)/sbin && ln -sf rc mtd-write
94 @cd $(INSTALLDIR)/sbin && ln -sf rc mtd-erase
95 @cd $(INSTALLDIR)/sbin && ln -sf rc mtd-unlock
97 @cd $(INSTALLDIR)/sbin && ln -sf rc dhcpc-event
98 @cd $(INSTALLDIR)/sbin && ln -sf rc dhcpc-release
99 @cd $(INSTALLDIR)/sbin && ln -sf rc dhcpc-renew
101 @cd $(INSTALLDIR)/sbin && ln -sf rc wldist
103 ifeq ($(TCONFIG_IPV6),y)
104 @cd $(INSTALLDIR)/sbin && ln -sf rc dhcp6c-state
105 endif
107 ifeq ($(TCONFIG_DDNS),y)
108 @cd $(INSTALLDIR)/sbin && ln -sf rc ddns-update
109 endif
111 ifeq ($(TCONFIG_CIFS),y)
112 @cd $(INSTALLDIR)/sbin && ln -sf rc mount-cifs
113 endif
115 ifeq ($(TOMATO_SL),1)
116 @cd $(INSTALLDIR)/sbin && ln -sf rc usbevent
117 @cd $(INSTALLDIR)/sbin && ln -sf rc usbrescan
118 @cd $(INSTALLDIR)/sbin && ln -sf rc hotdiskadd
119 @cd $(INSTALLDIR)/sbin && ln -sf rc hotdiskremove
120 @cd $(INSTALLDIR)/sbin && ln -sf rc hotdiskerror
121 @cd $(INSTALLDIR)/sbin && ln -sf rc umountx
122 endif
124 ifeq ($(TCONFIG_OPENVPN),y)
125 @mkdir -p $(INSTALLDIR)/rom/openvpn
126 @cp openvpn-updown.sh $(INSTALLDIR)/rom/openvpn/updown.sh
127 @chmod 0755 $(INSTALLDIR)/rom/openvpn/updown.sh
128 endif
130 clean:
131 rm -f rc *.o .*.depend
133 size: rc
134 mipsel-uclibc-nm --print-size --size-sort rc
136 %.o: %.c .%.depend
137 @echo " [rc] CC $@"
138 @$(CC) $(CFLAGS) -c $<
140 .%.depend: %.c
141 @$(CC) $(CFLAGS) -M $< > $@
143 -include $(OBJS:%.o=.%.depend)
147 pswatch: pswatch.c
148 $(CC) -o $@ $^
149 $(STRIP) $@
150 $(CPTMP)