0f57daa3ab654ad902ecc31be1fe7c98468f4259
[openwrt.git] / package / openwrt / Makefile
1 include $(TOPDIR)/rules.mk
2
3 SHARED_INCLUDE:=${shell pwd}/include
4
5 libshared-compile libnvram-compile:
6 @$(MAKE) -C $(patsubst %-compile,%,$@) compile
7
8 libshared-install libnvram-install:
9 @$(MAKE) -C $(patsubst %-install,%,$@) install
10
11 libshared-clean libnvram-clean:
12 @$(MAKE) -C $(patsubst %-clean,%,$@) clean
13
14 $(TARGET_DIR)/sbin/mtd: mtd.c
15 $(TARGET_CC) -o $@ $<
16 $(STRIP) $@
17
18 $(TARGET_DIR)/sbin/jffs2root: jffs2root.c
19 $(TARGET_CC) -o $@ $<
20 $(STRIP) $@
21
22 # wlconf tool extracted from linksys firmware GPL.unpackedtree
23 # WRT54GS_3_37_2_1109_US
24 LINKSYS_TGZ_SITE=http://openwrt.openbsd-geek.de
25 LINKSYS_WLCONF_TGZ=linksys-wlconf.tar.gz
26 LINKSYS_WLCONF_DIR=$(BUILD_DIR)/linksys-wlconf
27 LINKSYS_WLCONF_TARGET_BINARY:=usr/sbin/wlconf
28
29 $(DL_DIR)/$(LINKSYS_WLCONF_TGZ):
30 $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_WLCONF_TGZ)
31
32 $(LINKSYS_WLCONF_DIR)/.unpacked: $(DL_DIR)/$(LINKSYS_WLCONF_TGZ)
33 zcat $(DL_DIR)/$(LINKSYS_WLCONF_TGZ) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
34 touch $(LINKSYS_WLCONF_DIR)/.unpacked
35
36 $(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY): $(LINKSYS_WLCONF_DIR)/.unpacked
37 $(MAKE) -C $(LINKSYS_WLCONF_DIR) INSTALLDIR=$(TARGET_DIR) \
38 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
39 CFLAGS="$(TARGET_CFLAGS) -I. -I$(SHARED_INCLUDE) \
40 -Wall -DOPENWRT_WLCONF" \
41 LDFLAGS="-lnvram -lshared" \
42 install
43 $(STRIP) $@
44
45
46 source:
47 prepare:
48 compile: libnvram-compile libshared-compile
49 install: libnvram-install libshared-install $(TARGET_DIR)/sbin/mtd $(TARGET_DIR)/sbin/jffs2root $(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY)
50 clean: libnvram-clean libshared-clean
51 rm -rf $(LINKSYS_WLCONF_DIR)
52 rm -f $(TARGET_DIR)/sbin/mtd
53 rm -f $(TARGET_DIR)/sbin/jffs2root
This page took 0.039308 seconds and 3 git commands to generate.