summaryrefslogtreecommitdiff
path: root/package/openwrt/openwrt.mk
diff options
context:
space:
mode:
Diffstat (limited to 'package/openwrt/openwrt.mk')
-rw-r--r--package/openwrt/openwrt.mk132
1 files changed, 79 insertions, 53 deletions
diff --git a/package/openwrt/openwrt.mk b/package/openwrt/openwrt.mk
index d58a367f12..06d0172a44 100644
--- a/package/openwrt/openwrt.mk
+++ b/package/openwrt/openwrt.mk
@@ -1,58 +1,92 @@
#############################################################
#
-# openwrt tools
+# linksys and openwrt tools
#
#############################################################
-OPENWRT_SITE=http://openwrt.openbsd-geek.de
+LINKSYS_KERNEL_INCLUDE=$(BUILD_DIR)/linksys-kernel
-# shared library
-OPENWRT_SHARED_SOURCE=openwrt-shared.tar.gz
-OPENWRT_SHARED_DIR=$(BUILD_DIR)/openwrt-shared
-OPENWRT_SHARED_TARGET_BINARY:=usr/lib/libshared.so
+# 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
-$(DL_DIR)/$(OPENWRT_SHARED_SOURCE):
- $(WGET) -P $(DL_DIR) $(OPENWRT_SITE)/$(OPENWRT_SHARED_SOURCE)
+$(DL_DIR)/$(LINKSYS_SHARED_TGZ):
+ $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_SHARED_TGZ)
-$(OPENWRT_SHARED_DIR)/.source: $(DL_DIR)/$(OPENWRT_SHARED_SOURCE)
- zcat $(DL_DIR)/$(OPENWRT_SHARED_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- touch $(OPENWRT_SHARED_DIR)/.source
+$(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
-$(TARGET_DIR)/$(OPENWRT_SHARED_TARGET_BINARY): $(OPENWRT_SHARED_DIR)/.source
- $(MAKE) -C $(OPENWRT_SHARED_DIR) -f Makefile-openwrt \
+$(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 \
INSTALLDIR=$(TARGET_DIR) \
CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
- CFLAGS="$(TARGET_CFLAGS) -I. -I../binary/include -Wall -I$(OPENWRT_SRCBASE)/" \
+ CFLAGS="$(TARGET_CFLAGS) -I$(LINKSYS_KERNEL_INCLUDE)/include \
+ -I$(LINKSYS_KERNEL_INCLUDE) -Wall -I." \
install
-openwrt-shared: $(TARGET_DIR)/$(OPENWRT_SHARED_TARGET_BINARY)
+linksys-shared: $(TARGET_DIR)/$(LINKSYS_SHARED_TARGET_BINARY)
-openwrt-shared-clean:
- -$(MAKE) -C $(OPENWRT_SHARED_DIR) clean
+linksys-shared-clean:
+ -$(MAKE) -C $(LINKSYS_SHARED_DIR) clean
-# nvram tool
-OPENWRT_NVRAM_SOURCE=openwrt-nvram.tar.gz
-OPENWRT_NVRAM_DIR=$(BUILD_DIR)/openwrt-nvram
-OPENWRT_NVRAM_TARGET_BINARY:=usr/sbin/nvram
+# 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
-$(DL_DIR)/$(OPENWRT_NVRAM_SOURCE):
- $(WGET) -P $(DL_DIR) $(OPENWRT_SITE)/$(OPENWRT_NVRAM_SOURCE)
+$(DL_DIR)/$(LINKSYS_NVRAM_TGZ):
+ $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_NVRAM_TGZ)
-$(OPENWRT_NVRAM_DIR)/.source: $(DL_DIR)/$(OPENWRT_NVRAM_SOURCE)
- zcat $(DL_DIR)/$(OPENWRT_NVRAM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- touch $(OPENWRT_NVRAM_DIR)/.source
+$(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
-$(TARGET_DIR)/$(OPENWRT_NVRAM_TARGET_BINARY): $(OPENWRT_NVRAM_DIR)/.source
- $(MAKE) -C $(OPENWRT_NVRAM_DIR) INSTALLDIR=$(TARGET_DIR) \
+$(TARGET_DIR)/$(LINKSYS_NVRAM_TARGET_BINARY): $(LINKSYS_NVRAM_DIR)/.source
+ $(MAKE) -C $(LINKSYS_NVRAM_DIR) INSTALLDIR=$(TARGET_DIR) \
CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
- CFLAGS="$(TARGET_CFLAGS) -I. -I../binary/include -Wall -DOPENWRT_NVRAM" \
+ 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
+
+# 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" \
install
-openwrt-nvram: $(TARGET_DIR)/$(OPENWRT_NVRAM_TARGET_BINARY)
+linksys-wlconf: $(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY)
+
+linksys-wlconf-clean:
+ -$(MAKE) -C $(LINKSYS_WLCONF_BUILD_DIR) clean
-openwrt-nvram-clean:
- -$(MAKE) -C $(OPENWRT_NVRAM_BUILD_DIR) clean
# mtd tool
OPENWRT_MTD_SOURCE=package/openwrt/mtd.c
@@ -63,32 +97,24 @@ $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY):
openwrt-mtd: $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
-# wlconf tool
-OPENWRT_WLCONF_SOURCE=openwrt-wlconf.tar.gz
-OPENWRT_WLCONF_DIR=$(BUILD_DIR)/openwrt-wlconf
-OPENWRT_WLCONF_TARGET_BINARY:=usr/sbin/wlconf
-
-$(DL_DIR)/$(OPENWRT_WLCONF_SOURCE):
- $(WGET) -P $(DL_DIR) $(OPENWRT_SITE)/$(OPENWRT_WLCONF_SOURCE)
+# trx tool
+OPENWRT_TRX_SOURCE=package/openwrt/trx.c
+OPENWRT_TRX_TARGET=$(BUILD_DIR)/trx
-$(OPENWRT_WLCONF_DIR)/.source: $(DL_DIR)/$(OPENWRT_WLCONF_SOURCE)
- zcat $(DL_DIR)/$(OPENWRT_WLCONF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- touch $(OPENWRT_WLCONF_DIR)/.source
+$(OPENWRT_TRX_TARGET):
+ $(CC) -o $(OPENWRT_TRX_TARGET) $(OPENWRT_TRX_SOURCE)
-$(TARGET_DIR)/$(OPENWRT_WLCONF_TARGET_BINARY): $(OPENWRT_WLCONF_DIR)/.source
- $(MAKE) -C $(OPENWRT_WLCONF_DIR) INSTALLDIR=$(TARGET_DIR) \
- CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
- CFLAGS="$(TARGET_CFLAGS) -I. -I../binary/include -I$(BUILD_DIR)/openwrt-shared \
- -I$(BUILD_DIR)/openwrt-nvram -Wall -DOPENWRT_WLCONF" \
- LDFLAGS="-lnvram -lshared -L$(BUILD_DIR)/openwrt-shared -L$(BUILD_DIR)/openwrt-nvram" \
- install
+openwrt-trx: $(OPENWRT_TRX_TARGET)
-openwrt-wlconf: $(TARGET_DIR)/$(OPENWRT_WLCONF_TARGET_BINARY)
+# addpattern tool
+OPENWRT_ADDPATTERN_SOURCE=package/openwrt/addpattern.c
+OPENWRT_ADDPATTERN_TARGET=$(BUILD_DIR)/addpattern
-openwrt-wlconf-clean:
- -$(MAKE) -C $(OPENWRT_WLCONF_BUILD_DIR) clean
+$(OPENWRT_ADDPATTERN_TARGET):
+ $(CC) -o $(OPENWRT_ADDPATTERN_TARGET) $(OPENWRT_ADDPATTERN_SOURCE)
+openwrt-addpattern: $(OPENWRT_ADDPATTERN_TARGET)
-openwrt: openwrt-shared openwrt-nvram openwrt-mtd openwrt-wlconf
+openwrt: linksys-shared linksys-nvram linksys-wlconf openwrt-mtd openwrt-trx openwrt-addpattern