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
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
18 OBJS
+= new_qoslimit.o
21 ifeq ($(TCONFIG_USB
),y
)
24 ifeq ($(TCONFIG_DDNS
),y
)
27 ifeq ($(TCONFIG_CIFS
),y
)
30 ifeq ($(TCONFIG_JFFS2
),y
)
33 ifeq ($(TCONFIG_OPENVPN
),y
)
36 ifeq ($(TCONFIG_NOCAT
),y
)
39 ifeq ($(TCONFIG_PPTPD
),y
)
42 ifeq ($(TCONFIG_NGINX
),y
)
51 ifeq ($(TCONFIG_SNMP
),y
)
55 ifeq ($(TCONFIG_USERPPTP
),y
)
63 @
$(CC
) -o
$@
$^
$(LDFLAGS
)
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
107 ifeq ($(TCONFIG_DDNS
),y
)
108 @cd
$(INSTALLDIR
)/sbin
&& ln
-sf rc ddns-update
111 ifeq ($(TCONFIG_CIFS
),y
)
112 @cd
$(INSTALLDIR
)/sbin
&& ln
-sf rc mount-cifs
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
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
131 rm -f rc
*.o .
*.depend
134 mipsel-uclibc-nm
--print-size
--size-sort rc
138 @
$(CC
) $(CFLAGS
) -c
$<
141 @
$(CC
) $(CFLAGS
) -M
$< > $@
143 -include $(OBJS
:%.o
=.
%.depend
)