2005-02-08 10:20:25 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
2005-02-12 04:36:55 +02:00
|
|
|
# linksys and openwrt tools
|
2005-02-08 10:20:25 +02:00
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
|
2005-02-19 09:41:29 +02:00
|
|
|
LINKSYS_TGZ_SITE=http://openwrt.openbsd-geek.de
|
2005-02-12 04:36:55 +02:00
|
|
|
LINKSYS_KERNEL_INCLUDE=$(BUILD_DIR)/linksys-kernel
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
# shared library stuff extracted from linksys firmware GPL sourcetree
|
|
|
|
# WRT54GS_3_37_2_1109_US
|
|
|
|
LINKSYS_SHARED_TGZ=linksys-shared.tar.gz
|
|
|
|
LINKSYS_SHARED_DIR=$(BUILD_DIR)/linksys-shared
|
|
|
|
LINKSYS_SHARED_TARGET_BINARY:=usr/lib/libshared.so
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
$(DL_DIR)/$(LINKSYS_SHARED_TGZ):
|
|
|
|
$(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_SHARED_TGZ)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
$(LINKSYS_SHARED_DIR)/.source: $(DL_DIR)/$(LINKSYS_SHARED_TGZ)
|
|
|
|
zcat $(DL_DIR)/$(LINKSYS_SHARED_TGZ) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
|
|
|
touch $(LINKSYS_SHARED_DIR)/.source
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
$(TARGET_DIR)/$(LINKSYS_SHARED_TARGET_BINARY): $(LINKSYS_SHARED_DIR)/.source
|
|
|
|
$(SED) 's/#include.*/#include <cy_conf.h>/g;' $(LINKSYS_SHARED_DIR)/utils.h
|
|
|
|
$(MAKE) -C $(LINKSYS_SHARED_DIR) -f Makefile-openwrt \
|
2005-02-08 10:20:25 +02:00
|
|
|
INSTALLDIR=$(TARGET_DIR) \
|
|
|
|
CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
|
2005-02-12 04:36:55 +02:00
|
|
|
CFLAGS="$(TARGET_CFLAGS) -I$(LINKSYS_KERNEL_INCLUDE)/include \
|
|
|
|
-I$(LINKSYS_KERNEL_INCLUDE) -Wall -I." \
|
2005-02-08 10:20:25 +02:00
|
|
|
install
|
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
linksys-shared: $(TARGET_DIR)/$(LINKSYS_SHARED_TARGET_BINARY)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
linksys-shared-clean:
|
|
|
|
-$(MAKE) -C $(LINKSYS_SHARED_DIR) clean
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-21 06:42:12 +02:00
|
|
|
linksys-shared-dirclean:
|
|
|
|
rm -rf $(LINKSYS_SHARED_DIR)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
# nvram tool extracted from linksys firmware GPL sourcetree
|
|
|
|
# WRT54GS_3_37_2_1109_US
|
|
|
|
LINKSYS_NVRAM_TGZ=linksys-nvram.tar.gz
|
|
|
|
LINKSYS_NVRAM_DIR=$(BUILD_DIR)/linksys-nvram
|
|
|
|
LINKSYS_NVRAM_TARGET_BINARY:=usr/sbin/nvram
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
$(DL_DIR)/$(LINKSYS_NVRAM_TGZ):
|
|
|
|
$(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_NVRAM_TGZ)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
$(LINKSYS_NVRAM_DIR)/.source: $(DL_DIR)/$(LINKSYS_NVRAM_TGZ)
|
|
|
|
zcat $(DL_DIR)/$(LINKSYS_NVRAM_TGZ) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
|
|
|
touch $(LINKSYS_NVRAM_DIR)/.source
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
$(TARGET_DIR)/$(LINKSYS_NVRAM_TARGET_BINARY): $(LINKSYS_NVRAM_DIR)/.source
|
|
|
|
$(MAKE) -C $(LINKSYS_NVRAM_DIR) INSTALLDIR=$(TARGET_DIR) \
|
2005-02-08 10:20:25 +02:00
|
|
|
CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
|
2005-02-12 04:36:55 +02:00
|
|
|
CFLAGS="$(TARGET_CFLAGS) -I. -I$(LINKSYS_KERNEL_INCLUDE)/include \
|
|
|
|
-I$(LINKSYS_KERNEL_INCLUDE) -I$(LINKSYS_SHARED_DIR) -Wall" install
|
|
|
|
|
|
|
|
linksys-nvram: $(TARGET_DIR)/$(LINKSYS_NVRAM_TARGET_BINARY)
|
|
|
|
|
|
|
|
linksys-nvram-clean:
|
|
|
|
-$(MAKE) -C $(LINKSYS_NVRAM_BUILD_DIR) clean
|
|
|
|
|
2005-02-21 06:42:12 +02:00
|
|
|
linksys-nvram-dirclean:
|
2005-02-21 08:03:54 +02:00
|
|
|
rm -rf $(LINKSYS_NVRAM_DIR)
|
2005-02-21 06:42:12 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
# wlconf tool extracted from linksys firmware GPL sourcetree
|
|
|
|
# WRT54GS_3_37_2_1109_US
|
|
|
|
LINKSYS_WLCONF_TGZ=linksys-wlconf.tar.gz
|
|
|
|
LINKSYS_WLCONF_DIR=$(BUILD_DIR)/linksys-wlconf
|
|
|
|
LINKSYS_WLCONF_TARGET_BINARY:=usr/sbin/wlconf
|
|
|
|
|
|
|
|
$(DL_DIR)/$(LINKSYS_WLCONF_TGZ):
|
|
|
|
$(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_WLCONF_TGZ)
|
|
|
|
|
|
|
|
$(LINKSYS_WLCONF_DIR)/.source: $(DL_DIR)/$(LINKSYS_WLCONF_TGZ)
|
|
|
|
zcat $(DL_DIR)/$(LINKSYS_WLCONF_TGZ) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
|
|
|
touch $(LINKSYS_WLCONF_DIR)/.source
|
|
|
|
|
|
|
|
$(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY): $(LINKSYS_WLCONF_DIR)/.source
|
|
|
|
$(MAKE) -C $(LINKSYS_WLCONF_DIR) INSTALLDIR=$(TARGET_DIR) \
|
|
|
|
CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS) -I. -I$(LINKSYS_KERNEL_INCLUDE)/include \
|
|
|
|
-I$(LINKSYS_KERNEL_INCLUDE) \
|
|
|
|
-I$(LINKSYS_SHARED_DIR) \
|
|
|
|
-I$(LINKSYS_NVRAM_DIR) \
|
|
|
|
-Wall -DOPENWRT_WLCONF" \
|
|
|
|
LDFLAGS="-lnvram -lshared -L$(BUILD_DIR)/linksys-shared -L$(BUILD_DIR)/linksys-nvram" \
|
2005-02-08 10:20:25 +02:00
|
|
|
install
|
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
linksys-wlconf: $(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY)
|
|
|
|
|
|
|
|
linksys-wlconf-clean:
|
|
|
|
-$(MAKE) -C $(LINKSYS_WLCONF_BUILD_DIR) clean
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-21 06:42:12 +02:00
|
|
|
linksys-wlconf-dirclean:
|
2005-02-21 08:03:54 +02:00
|
|
|
rm -rf $(LINKSYS_WLCONF_DIR)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
|
|
|
# mtd tool
|
|
|
|
OPENWRT_MTD_SOURCE=package/openwrt/mtd.c
|
|
|
|
OPENWRT_MTD_TARGET_BINARY:=sbin/mtd
|
|
|
|
|
|
|
|
$(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY):
|
|
|
|
$(TARGET_CC) -o $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY) $(OPENWRT_MTD_SOURCE)
|
|
|
|
|
|
|
|
openwrt-mtd: $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
|
|
|
|
|
2005-02-21 06:42:12 +02:00
|
|
|
openwrt-mtd-clean:
|
|
|
|
rm $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
|
|
|
|
|
|
|
|
# jffs2root tool
|
|
|
|
OPENWRT_JFFS2ROOT_SOURCE=package/openwrt/jffs2root.c
|
|
|
|
OPENWRT_JFFS2ROOT_TARGET_BINARY:=sbin/jffs2root
|
|
|
|
|
2005-03-04 09:59:08 +02:00
|
|
|
$(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY): openwrt
|
2005-02-21 06:42:12 +02:00
|
|
|
$(TARGET_CC) -o $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY) $(OPENWRT_JFFS2ROOT_SOURCE)
|
|
|
|
|
|
|
|
openwrt-jffs2root: $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY)
|
|
|
|
|
|
|
|
openwrt-jffs2root-clean:
|
|
|
|
rm $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY)
|
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
# trx tool
|
|
|
|
OPENWRT_TRX_SOURCE=package/openwrt/trx.c
|
2005-02-12 08:12:34 +02:00
|
|
|
OPENWRT_TRX_TARGET=$(STAGING_DIR)/bin/trx
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
$(OPENWRT_TRX_TARGET):
|
|
|
|
$(CC) -o $(OPENWRT_TRX_TARGET) $(OPENWRT_TRX_SOURCE)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
openwrt-trx: $(OPENWRT_TRX_TARGET)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-21 06:42:12 +02:00
|
|
|
openwrt-trx-clean:
|
|
|
|
rm $(OPENWRT_TRX_TARGET)
|
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
# addpattern tool
|
|
|
|
OPENWRT_ADDPATTERN_SOURCE=package/openwrt/addpattern.c
|
2005-02-12 08:12:34 +02:00
|
|
|
OPENWRT_ADDPATTERN_TARGET=$(STAGING_DIR)/bin/addpattern
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
$(OPENWRT_ADDPATTERN_TARGET):
|
|
|
|
$(CC) -o $(OPENWRT_ADDPATTERN_TARGET) $(OPENWRT_ADDPATTERN_SOURCE)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-12 04:36:55 +02:00
|
|
|
openwrt-addpattern: $(OPENWRT_ADDPATTERN_TARGET)
|
2005-02-08 10:20:25 +02:00
|
|
|
|
2005-02-21 06:42:12 +02:00
|
|
|
openwrt-addpattern-clean:
|
|
|
|
rm $(OPENWRT_ADDPATTERN_TARGET)
|
|
|
|
|
2005-02-22 07:19:06 +02:00
|
|
|
# sstrip tool
|
|
|
|
OPENWRT_SSTRIP_SOURCE=package/openwrt/sstrip.c
|
|
|
|
OPENWRT_SSTRIP_TARGET=$(STAGING_DIR)/bin/sstrip
|
|
|
|
|
|
|
|
$(OPENWRT_SSTRIP_TARGET):
|
|
|
|
$(CC) -o $(OPENWRT_SSTRIP_TARGET) $(OPENWRT_SSTRIP_SOURCE)
|
|
|
|
|
|
|
|
openwrt-sstrip: $(OPENWRT_SSTRIP_TARGET)
|
|
|
|
|
|
|
|
openwrt-sstrip-clean:
|
|
|
|
rm $(OPENWRT_SSTRIP_TARGET)
|
|
|
|
|
2005-03-01 09:05:19 +02:00
|
|
|
SSTRIP=$(OPENWRT_SSTRIP_TARGET)
|
2005-02-22 07:19:06 +02:00
|
|
|
|
2005-02-21 08:03:54 +02:00
|
|
|
linksys: linksys-shared linksys-nvram linksys-wlconf
|
|
|
|
|
2005-03-04 09:59:08 +02:00
|
|
|
openwrt: linksys openwrt-mtd openwrt-trx openwrt-addpattern openwrt-sstrip
|
2005-02-21 08:03:54 +02:00
|
|
|
|
|
|
|
openwrt-dirclean: linksys-shared-dirclean linksys-nvram-dirclean linksys-wlconf-dirclean
|
2005-02-08 10:20:25 +02:00
|
|
|
|