1 #############################################################
3 # linksys and openwrt tools
5 #############################################################
7 LINKSYS_KERNEL_INCLUDE
=$(BUILD_DIR
)/linksys-kernel
9 # shared library stuff extracted from linksys firmware GPL sourcetree
10 # WRT54GS_3_37_2_1109_US
11 LINKSYS_SHARED_TGZ
=linksys-shared.
tar.gz
12 LINKSYS_SHARED_DIR
=$(BUILD_DIR
)/linksys-shared
13 LINKSYS_SHARED_TARGET_BINARY
:=usr
/lib
/libshared.so
15 $(DL_DIR
)/$(LINKSYS_SHARED_TGZ
):
16 $(WGET
) -P
$(DL_DIR
) $(LINKSYS_TGZ_SITE
)/$(LINKSYS_SHARED_TGZ
)
18 $(LINKSYS_SHARED_DIR
)/.source
: $(DL_DIR
)/$(LINKSYS_SHARED_TGZ
)
19 zcat
$(DL_DIR
)/$(LINKSYS_SHARED_TGZ
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
20 touch
$(LINKSYS_SHARED_DIR
)/.source
22 $(TARGET_DIR
)/$(LINKSYS_SHARED_TARGET_BINARY
): $(LINKSYS_SHARED_DIR
)/.source
23 $(SED
) 's/#include.*/#include <cy_conf.h>/g;' $(LINKSYS_SHARED_DIR
)/utils.h
24 $(MAKE
) -C
$(LINKSYS_SHARED_DIR
) -f Makefile-openwrt \
25 INSTALLDIR
=$(TARGET_DIR
) \
26 CC
=$(TARGET_CC
) LD
=$(TARGET_CROSS
)ld STRIP
="$(STRIP)" \
27 CFLAGS
="$(TARGET_CFLAGS) -I$(LINKSYS_KERNEL_INCLUDE)/include \
28 -I$(LINKSYS_KERNEL_INCLUDE) -Wall -I." \
31 linksys-shared
: $(TARGET_DIR
)/$(LINKSYS_SHARED_TARGET_BINARY
)
34 -$(MAKE
) -C
$(LINKSYS_SHARED_DIR
) clean
37 # nvram tool extracted from linksys firmware GPL sourcetree
38 # WRT54GS_3_37_2_1109_US
39 LINKSYS_NVRAM_TGZ
=linksys-nvram.
tar.gz
40 LINKSYS_NVRAM_DIR
=$(BUILD_DIR
)/linksys-nvram
41 LINKSYS_NVRAM_TARGET_BINARY
:=usr
/sbin
/nvram
43 $(DL_DIR
)/$(LINKSYS_NVRAM_TGZ
):
44 $(WGET
) -P
$(DL_DIR
) $(LINKSYS_TGZ_SITE
)/$(LINKSYS_NVRAM_TGZ
)
46 $(LINKSYS_NVRAM_DIR
)/.source
: $(DL_DIR
)/$(LINKSYS_NVRAM_TGZ
)
47 zcat
$(DL_DIR
)/$(LINKSYS_NVRAM_TGZ
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
48 touch
$(LINKSYS_NVRAM_DIR
)/.source
50 $(TARGET_DIR
)/$(LINKSYS_NVRAM_TARGET_BINARY
): $(LINKSYS_NVRAM_DIR
)/.source
51 $(MAKE
) -C
$(LINKSYS_NVRAM_DIR
) INSTALLDIR
=$(TARGET_DIR
) \
52 CC
=$(TARGET_CC
) LD
=$(TARGET_CROSS
)ld STRIP
="$(STRIP)" \
53 CFLAGS
="$(TARGET_CFLAGS) -I. -I$(LINKSYS_KERNEL_INCLUDE)/include \
54 -I$(LINKSYS_KERNEL_INCLUDE) -I$(LINKSYS_SHARED_DIR) -Wall" install
56 linksys-nvram
: $(TARGET_DIR
)/$(LINKSYS_NVRAM_TARGET_BINARY
)
59 -$(MAKE
) -C
$(LINKSYS_NVRAM_BUILD_DIR
) clean
61 # wlconf tool extracted from linksys firmware GPL sourcetree
62 # WRT54GS_3_37_2_1109_US
63 LINKSYS_WLCONF_TGZ
=linksys-wlconf.
tar.gz
64 LINKSYS_WLCONF_DIR
=$(BUILD_DIR
)/linksys-wlconf
65 LINKSYS_WLCONF_TARGET_BINARY
:=usr
/sbin
/wlconf
67 $(DL_DIR
)/$(LINKSYS_WLCONF_TGZ
):
68 $(WGET
) -P
$(DL_DIR
) $(LINKSYS_TGZ_SITE
)/$(LINKSYS_WLCONF_TGZ
)
70 $(LINKSYS_WLCONF_DIR
)/.source
: $(DL_DIR
)/$(LINKSYS_WLCONF_TGZ
)
71 zcat
$(DL_DIR
)/$(LINKSYS_WLCONF_TGZ
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
72 touch
$(LINKSYS_WLCONF_DIR
)/.source
74 $(TARGET_DIR
)/$(LINKSYS_WLCONF_TARGET_BINARY
): $(LINKSYS_WLCONF_DIR
)/.source
75 $(MAKE
) -C
$(LINKSYS_WLCONF_DIR
) INSTALLDIR
=$(TARGET_DIR
) \
76 CC
=$(TARGET_CC
) LD
=$(TARGET_CROSS
)ld STRIP
="$(STRIP)" \
77 CFLAGS
="$(TARGET_CFLAGS) -I. -I$(LINKSYS_KERNEL_INCLUDE)/include \
78 -I$(LINKSYS_KERNEL_INCLUDE) \
79 -I$(LINKSYS_SHARED_DIR) \
80 -I$(LINKSYS_NVRAM_DIR) \
81 -Wall -DOPENWRT_WLCONF" \
82 LDFLAGS
="-lnvram -lshared -L$(BUILD_DIR)/linksys-shared -L$(BUILD_DIR)/linksys-nvram" \
85 linksys-wlconf
: $(TARGET_DIR
)/$(LINKSYS_WLCONF_TARGET_BINARY
)
88 -$(MAKE
) -C
$(LINKSYS_WLCONF_BUILD_DIR
) clean
92 OPENWRT_MTD_SOURCE
=package
/openwrt
/mtd.c
93 OPENWRT_MTD_TARGET_BINARY
:=sbin
/mtd
95 $(TARGET_DIR
)/$(OPENWRT_MTD_TARGET_BINARY
):
96 $(TARGET_CC
) -o
$(TARGET_DIR
)/$(OPENWRT_MTD_TARGET_BINARY
) $(OPENWRT_MTD_SOURCE
)
98 openwrt-mtd
: $(TARGET_DIR
)/$(OPENWRT_MTD_TARGET_BINARY
)
101 OPENWRT_TRX_SOURCE
=package
/openwrt
/trx.c
102 OPENWRT_TRX_TARGET
=$(BUILD_DIR
)/trx
104 $(OPENWRT_TRX_TARGET
):
105 $(CC
) -o
$(OPENWRT_TRX_TARGET
) $(OPENWRT_TRX_SOURCE
)
107 openwrt-trx
: $(OPENWRT_TRX_TARGET
)
110 OPENWRT_ADDPATTERN_SOURCE
=package
/openwrt
/addpattern.c
111 OPENWRT_ADDPATTERN_TARGET
=$(BUILD_DIR
)/addpattern
113 $(OPENWRT_ADDPATTERN_TARGET
):
114 $(CC
) -o
$(OPENWRT_ADDPATTERN_TARGET
) $(OPENWRT_ADDPATTERN_SOURCE
)
116 openwrt-addpattern
: $(OPENWRT_ADDPATTERN_TARGET
)
118 openwrt
: linksys-shared linksys-nvram linksys-wlconf openwrt-mtd openwrt-trx openwrt-addpattern