2 # Linux router shared code Makefile
4 # Copyright 2001-2003, Broadcom Corporation
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.
13 include $(TOPDIR
)/rules.mk
16 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)
18 EXTRA_CFLAGS
:= -c
-I.
-I..
/include
23 $(PKG_BUILD_DIR
)/$(1): $(PKG_BUILD_DIR
)
24 $(TARGET_CC
) $(TARGET_CFLAGS
) $(EXTRA_CFLAGS
) -o
$$@
$$(patsubst %.o
,%.c
,$(1))
27 OBJS
:= nvram_linux.o nvram_convert.o main.o
28 LIBNVRAM_OBJS
:= $(PKG_BUILD_DIR
)/nvram_linux.o
$(PKG_BUILD_DIR
)/nvram_convert.o
29 $(foreach obj
,$(OBJS
),$(eval
$(call OBJ_template
,$(obj
))))
32 mkdir
-p
$(PKG_BUILD_DIR
)
34 $(PKG_BUILD_DIR
)/nvram
: $(PKG_BUILD_DIR
)/main.o
35 $(TARGET_CC
) $(TARGET_CFLAGS
) -o
$@
$^
-L
$(PKG_BUILD_DIR
) -lnvram
37 $(PKG_BUILD_DIR
)/libnvram.so
: $(LIBNVRAM_OBJS
)
38 $(TARGET_CC
) -shared
-o
$@
$^
40 $(TARGET_DIR
)/usr
/lib
/libnvram.so
: $(PKG_BUILD_DIR
)/libnvram.so
42 install -m
644 $< $(STAGING_DIR
)/lib
/libnvram.so
45 $(TARGET_DIR
)/usr
/sbin
/nvram
: $(PKG_BUILD_DIR
)/nvram
46 mkdir
-p
$(TARGET_DIR
)/usr
/sbin
50 compile
: $(PKG_BUILD_DIR
)/libnvram.so
$(PKG_BUILD_DIR
)/nvram
51 install: $(TARGET_DIR
)/usr
/lib
/libnvram.so
$(TARGET_DIR
)/usr
/sbin
/nvram
54 rm -rf
$(PKG_BUILD_DIR
)