2 # Copyright 2005, Broadcom Corporation
5 # THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
6 # KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
7 # SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8 # FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
10 # $Id: Makefile,v 1.8 2005/03/07 08:35:32 kanki Exp $
17 ifeq ($(PLATFORM
), mipsel
)
18 export PATH
:=/projects
/hnd
/tools
/linux
/hndtools-mipsel-linux
/bin
:${PATH}
19 TARGET_PREFIX
= mipsel-linux-
25 CC
= $(TARGET_PREFIX
)gcc
26 AS
= $(TARGET_PREFIX
)as
27 AR
= $(TARGET_PREFIX
)ar
28 LD
= $(TARGET_PREFIX
)ld
29 CCPP
= $(TARGET_PREFIX
)g
++
30 COMPILER
= $(TARGET_PREFIX
)g
++
31 STRIP
= $(TARGET_PREFIX
)strip
32 SIZE
= $(TARGET_PREFIX
)size
34 VPATH.h
= .
:..
:..
/..
/include:$(SRCBASE
)/include:$(SRCBASE
)/router
/shared
36 vpath
%.c .
:..
:$(SRCBASE
)/shared
/netconf
41 CFLAGS
+= -g
-DDEBUG
-UNDEBUG
-DBCMDBG
43 CFLAGS
+= -O2
-DNDEBUG
45 CFLAGS
+= -I
$(subst :, -I
,$(VPATH.h
))
46 CFLAGS
+= -Wall
-Wunused
47 #CFLAGS += --trace-includes
50 # compile in the generic UPNP IGD files.
52 SOURCES
= igd.c igd_desc.c wancommon.c wanipc.c ipt.c \
54 x_wanpppconnection.c wanppp.c \
57 # Add the OS-specific source files.
58 SOURCES
+= linux_main.c linux_net.c linux_igd.c
61 SOURCES.TEST
= test.c shutils.c
63 SOURCES.OBJ
:= $(SOURCES
)
64 SOURCES.OBJ
:= $(patsubst %.c
,$(OBJDIR
)/%.o
,$(SOURCES.OBJ
))
67 LIBS
= -L..
/..
/upnp
/linux
-L
$(SRCBASE
)/router
/netconf \
68 -L
$(SRCBASE
)/router
/nvram
-L
$(SRCBASE
)/router
/shared
-lupnp
-lnetconf
-lnvram
-lshared
70 all : $(OBJDIR
) $(TARGET
)
79 $(SOURCES.OBJ
): upnp.h
$(SRCBASE
)/include/cyutils.h
$(SRCBASE
)/include/code_pattern.h
82 $(CC
) $(CFLAGS
) $(INCLUDES
) -o
$@
-c
$<
84 # uncomment BUILD_LIBS if you want this makefile to build the netconf and itables libraries.
87 ifneq ($(BUILD_LIBS
),)
89 $(TARGET
) :: libnetconf.so
91 $(TARGET
) :: $(SRCBASE
)/router
/iptables
/libiptables.a
93 $(TARGET
) :: $(SRCBASE
)/router
/nvram
/libnvram.a
95 $(SRCBASE
)/router
/iptables
/libiptables.a
: FORCE
96 $(MAKE
) -C
$(SRCBASE
)/router
/iptables PLATFORM
=x86 CC
=$(CC
) LD
=$(LD
) SRCBASE
=..
/.. TOP
=..
97 $(SRCBASE
)/router
/nvram
/libnvram.a
: FORCE
98 $(MAKE
) -C
$(SRCBASE
)/router
/nvram PLATFORM
=x86 CC
=$(CC
) LD
=$(LD
) SRCBASE
=..
/.. TOP
=..
100 $(SRCBASE
)/router
/netconf
/libnetconf.so
: $(SRCBASE
)/router
/iptables
/libiptables.a FORCE
101 $(MAKE
) -C
$(SRCBASE
)/router
/netconf DEBUG
=1 PLATFORM
=x86 CC
=$(CC
) LD
=$(LD
) SRCBASE
=..
/.. TOP
=..
103 libnetconf.so
: $(SRCBASE
)/router
/netconf
/libnetconf.so
104 # cp $(SRCBASE)/router/netconf/libnetconf.so /router/usr/lib/
109 ..
/..
/upnp
/linux
/libupnp.a
: FORCE
110 $(MAKE
) -C ..
/..
/upnp
/linux DEBUG
=$(DEBUG
) PLATFORM
=x86 CC
=$(CC
) LD
=$(LD
) VENDOR
=$(VENDOR
)
112 $(TARGET
) :: ..
/..
/upnp
/linux
/libupnp.a
$(SOURCES.OBJ
)
113 $(CC
) -o
$(TARGET
) $(SOURCES.OBJ
) $(LIBS
)
124 $(CC
) -o fptest fptest.o
$(LIBS
)
127 $(CC
) -o btest btest.o
131 .PHONY
: FORCE
clean libs