1# 2# Router rc control scripts Makefile 3# 4# Copyright (C) 2008, Broadcom Corporation 5# All Rights Reserved. 6# 7# THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY 8# KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM 9# SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 10# FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE. 11# 12# $Id: Makefile,v 1.45 2009/09/11 04:01:19 Exp $ 13# 14 15include $(TOP)/.config 16 17ifeq ($(LINUXDIR), $(SRCBASE)/linux/linux-2.6) 18CFLAGS += -DLINUX26 19CFLAGS += -DACOS_LINUX26 20 21CFLAGS += -I. -I$(TOP)/shared -I$(SRCBASE)/include -Wall -I$(LINUXDIR)/include -I$(TOP)/busybox-1.x 22else 23CFLAGS += -I. -I$(TOP)/shared -I$(TOP)/busybox -I$(SRCBASE)/include -Wall 24endif 25 26#CFLAGS += -g -DDEBUG 27CFLAGS += -s 28ifeq ($(CONFIG_RTR_OPTIMIZE_SIZE),y) 29CFLAGS += -Os 30else 31CFLAGS += -O2 32endif 33LDFLAGS += -L$(TOP)/nvram -L$(PLATFORMDIR)/install/nvram/usr/lib -lnvram -L$(TOP)/shared -L$(PLATFORMDIR)/install/shared/usr/lib -lshared \ 34 -L$(TOP)/libbcmcrypto -L$(INSTALLDIR)/libbcmcrypto/usr/lib -lbcmcrypto 35LDFLAGS += -L$(TOP)/libbcm -L$(INSTALLDIR)/libbcm/usr/lib -lbcm 36 37CFLAGS += -I$(SRCBASE)/../ap/acos/shared 38LDFLAGS += -L$(SRCBASE)/../ap/acos/shared -L$(TARGETDIR)/usr/lib -lacos_shared 39 40#Foxconn Silver added start, 2011/12/21, for kernel_ntfs 41ifeq ($(PROFILE),WNDR4500REV) 42CFLAGS += -DUSE_KERNEL_NTFS 43endif 44#Foxconn Silver added end, 2011/12/21, for kernel_ntfs 45 46ifeq ($(BUILD_WFA_APUT),1) 47CFLAGS += -DCAPI_AP 48endif 49 50ifeq ($(FW_TYPE),TWC) 51CFLAGS += -DBUILD_TWC 52endif 53ifeq ($(CONFIG_WAPI_IAS),y) 54CFLAGS += -DRC_BUILDTIME=$(shell date -d "now" +"%s") 55endif 56 57OBJS := rc.o init.o interface.o network.o services.o udhcpc.o http.o stats.o bcmutils.o mtd.o usb_hotplug.o pmon.o 58ifeq ($(CONFIG_BCMQOS),y) 59OBJS += qos.o 60endif 61 62ifeq ($(CONFIG_NAT),y) 63OBJS += firewall.o 64LDFLAGS += -L$(TOP)/netconf -L$(PLATFORMDIR)/install/netconf/usr/lib -lnetconf 65endif 66 67ifeq ($(CONFIG_NAT),y) 68OBJS += ppp.o 69endif 70 71ifeq ($(CONFIG_WCN),y) 72OBJS += usb_hotplug.o 73endif 74 75ifeq ($(PROFILE),WNR3500L) 76OBJS += hotplug_usb2.o 77endif 78 79ifeq ($(PROFILE),WNDR4500REV) 80OBJS += hotplug_usb2.o 81endif 82 83ifeq ($(PROFILE),WNDR3300v2) 84OBJS += hotplug_usb2.o 85endif 86 87vpath %.c $(TOP)/shared $(SRCBASE)/shared 88 89all: rc 90 91clean: 92 rm -f *.o rc .*.depend 93 94install: all 95 install -d $(INSTALLDIR)/sbin 96 install rc $(INSTALLDIR)/sbin 97 $(STRIP) $(INSTALLDIR)/sbin/rc 98 cd $(INSTALLDIR)/sbin && ln -sf rc init 99 cd $(INSTALLDIR)/sbin && ln -sf rc erase 100 cd $(INSTALLDIR)/sbin && ln -sf rc write 101 cd $(INSTALLDIR)/sbin && ln -sf rc stats 102 cd $(INSTALLDIR)/sbin && ln -sf rc hotplug 103 cd $(INSTALLDIR)/sbin && ln -sf rc preinit 104 105rc: $(OBJS) 106 $(CC) -o $@ $(OBJS) $(LDFLAGS) 107 108%.o: .%.depend 109.%.depend: %.c 110 $(CC) $(CFLAGS) -M $< > $@ 111 112-include $(OBJS:%.o=.%.depend) 113