3 include $(TOPDIR
)/rules.mk
6 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)
8 EXTRA_CFLAGS
:= -c
-I.
-I..
/include
13 $(PKG_BUILD_DIR
)/$(1): $(PKG_BUILD_DIR
)
14 $(TARGET_CC
) $(TARGET_CFLAGS
) $(EXTRA_CFLAGS
) -o
$$@
$$(patsubst %.o
,%.c
,$(1))
17 OBJS
:= nvram_linux.o nvram_convert.o main.o
18 LIBNVRAM_OBJS
:= $(PKG_BUILD_DIR
)/nvram_linux.o
$(PKG_BUILD_DIR
)/nvram_convert.o
19 $(foreach obj
,$(OBJS
),$(eval
$(call OBJ_template
,$(obj
))))
22 mkdir
-p
$(PKG_BUILD_DIR
)
24 $(PKG_BUILD_DIR
)/nvram
: $(PKG_BUILD_DIR
)/main.o
25 $(TARGET_CC
) $(TARGET_CFLAGS
) -o
$@
$^
-L
$(PKG_BUILD_DIR
) -lnvram
27 $(PKG_BUILD_DIR
)/libnvram.so
: $(LIBNVRAM_OBJS
)
28 $(TARGET_CC
) -shared
-o
$@
$^
30 $(TARGET_DIR
)/usr
/lib
/libnvram.so
: $(PKG_BUILD_DIR
)/libnvram.so
32 install -m
644 $< $(STAGING_DIR
)/lib
/libnvram.so
35 $(TARGET_DIR
)/usr
/sbin
/nvram
: $(PKG_BUILD_DIR
)/nvram
36 mkdir
-p
$(TARGET_DIR
)/usr
/sbin
40 compile
: $(PKG_BUILD_DIR
)/libnvram.so
$(PKG_BUILD_DIR
)/nvram
41 install: $(TARGET_DIR
)/usr
/lib
/libnvram.so
$(TARGET_DIR
)/usr
/sbin
/nvram
44 rm -rf
$(PKG_BUILD_DIR
)