3 include $(TOPDIR
)/rules.mk
5 PKG_NAME
:= openwrt-utils
7 PKG_BUILD_DIR
:= $(BUILD_DIR
)/$(PKG_NAME
)
8 PKG_IPK
:=$(PACKAGE_DIR
)/$(PKG_NAME
)_
$(PKG_RELEASE
)_
$(ARCH
).ipk
9 PKG_IPK_DIR
:=$(PKG_BUILD_DIR
)/ipkg
11 SHARED_INCLUDE
:=${shell pwd
}/include
13 libshared-compile libnvram-compile wlc-compile
:
14 @
$(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
16 libshared-install libnvram-install wlc-install
:
17 @
$(MAKE
) -C
$(patsubst %-install,%,$@
) install
19 libshared-clean libnvram-clean wlc-clean
:
20 @
$(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
22 $(PKG_IPK_DIR
)/sbin
/mtd
: mtd.c
23 mkdir
-p
$(PKG_IPK_DIR
)/sbin
26 $(PKG_IPK_DIR
)/sbin
/jffs2root
: jffs2root.c
27 mkdir
-p
$(PKG_IPK_DIR
)/sbin
30 $(PKG_IPK_DIR
)/usr
/sbin
/wlc
: wlc.c libshared-compile
31 mkdir
-p
$(PKG_IPK_DIR
)/usr
/sbin
32 $(TARGET_CC
) -o
$@
$< -lshared
-L.
/libshared
-I
$(SHARED_INCLUDE
)
34 # wlconf tool extracted from linksys firmware GPL.unpackedtree
35 # WRT54GS_3_37_2_1109_US
36 LINKSYS_TGZ_SITE
=http
://openwrt.openbsd-geek.de
37 LINKSYS_TGZ_MD5SUM
=1b596e5bf26d2898d1eab5bd200bee58
38 LINKSYS_WLCONF_TGZ
=linksys-wlconf.
tar.gz
39 LINKSYS_WLCONF_DIR
=$(BUILD_DIR
)/linksys-wlconf
41 $(DL_DIR
)/$(LINKSYS_WLCONF_TGZ
):
42 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(LINKSYS_WLCONF_TGZ
) $(LINKSYS_TGZ_MD5SUM
) $(LINKSYS_TGZ_SITE
)
44 $(LINKSYS_WLCONF_DIR
)/.unpacked
: $(DL_DIR
)/$(LINKSYS_WLCONF_TGZ
)
45 zcat
$(DL_DIR
)/$(LINKSYS_WLCONF_TGZ
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
46 touch
$(LINKSYS_WLCONF_DIR
)/.unpacked
48 $(TARGET_DIR
)/usr
/sbin
/wlconf
: $(LINKSYS_WLCONF_DIR
)/.unpacked
49 $(MAKE
) -C
$(LINKSYS_WLCONF_DIR
) INSTALLDIR
=$(TARGET_DIR
) \
50 CC
=$(TARGET_CC
) LD
=$(TARGET_CROSS
)ld STRIP
="$(STRIP)" \
51 CFLAGS
="$(TARGET_CFLAGS) -I. -I$(SHARED_INCLUDE) \
52 -Wall -DOPENWRT_WLCONF" \
53 LDFLAGS
="-lnvram -lshared" \
57 $(PKG_IPK
): $(PKG_IPK_DIR
)/sbin
/mtd
$(PKG_IPK_DIR
)/sbin
/jffs2root
$(PKG_IPK_DIR
)/usr
/sbin
/wlc
58 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_IPK_DIR
) $(PKG_NAME
).control
$(PKG_RELEASE
) $(ARCH
)
59 $(STRIP
) $(PKG_IPK_DIR
)/usr
/sbin
/*
60 $(STRIP
) $(PKG_IPK_DIR
)/sbin
/*
61 mkdir
-p
$(PACKAGE_DIR
)
62 $(IPKG_BUILD
) $(PKG_IPK_DIR
) $(PACKAGE_DIR
)
64 $(IPKG_STATE_DIR
)/info/$(PKG_NAME
).list
: $(PKG_IPK
)
65 $(IPKG
) install $(PKG_IPK
)
67 source
: $(DL_DIR
)/$(LINKSYS_WLCONF_TGZ
)
68 prepare
: $(LINKSYS_WLCONF_DIR
)/.unpacked
69 compile
: prepare libnvram-compile libshared-compile
$(PKG_IPK
)
70 install: libnvram-install libshared-install \
71 $(TARGET_DIR
)/usr
/sbin
/wlconf \
72 $(IPKG_STATE_DIR
)/info/$(PKG_NAME
).list
74 clean: libshared-clean libnvram-clean
75 rm -rf
$(PKG_BUILD_DIR
)