blob: cc80bc4a01f2965c220e9b13c5dd8fba0ff85b1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
#############################################################
#
# linksys and openwrt tools
#
#############################################################
LINKSYS_TGZ_SITE=http://openwrt.openbsd-geek.de
LINKSYS_KERNEL_INCLUDE=$(BUILD_DIR)/linksys-kernel
# 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)/$(LINKSYS_SHARED_TGZ):
$(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_SHARED_TGZ)
$(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)/$(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$(LINKSYS_KERNEL_INCLUDE)/include \
-I$(LINKSYS_KERNEL_INCLUDE) -Wall -I." \
install
linksys-shared: $(TARGET_DIR)/$(LINKSYS_SHARED_TARGET_BINARY)
linksys-shared-clean:
-$(MAKE) -C $(LINKSYS_SHARED_DIR) clean
linksys-shared-dirclean:
rm -rf $(LINKSYS_SHARED_DIR)
# 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)/$(LINKSYS_NVRAM_TGZ):
$(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_NVRAM_TGZ)
$(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)/$(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$(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
linksys-nvram-dirclean:
rm -rf $(LINKSYS_NVRAM_DIR)
# 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
linksys-wlconf: $(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY)
linksys-wlconf-clean:
-$(MAKE) -C $(LINKSYS_WLCONF_BUILD_DIR) clean
linksys-wlconf-dirclean:
rm -rf $(LINKSYS_WLCONF_DIR)
# mtd tool
OPENWRT_MTD_SOURCE=./mtd.c
OPENWRT_MTD_TARGET_BINARY:=sbin/mtd
$(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY):
$(TARGET_CC) -o $@ $(OPENWRT_MTD_SOURCE)
$(STRIP) $@
openwrt-mtd: $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
openwrt-mtd-clean:
rm $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
# jffs2root tool
OPENWRT_JFFS2ROOT_SOURCE=./jffs2root.c
OPENWRT_JFFS2ROOT_TARGET_BINARY:=sbin/jffs2root
$(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY):
$(TARGET_CC) -o $@ $(OPENWRT_JFFS2ROOT_SOURCE)
$(STRIP) $@
openwrt-jffs2root: $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY)
openwrt-jffs2root-clean:
rm $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY)
linksys: linksys-shared linksys-nvram linksys-wlconf
openwrt: linksys openwrt-mtd openwrt-jffs2root
openwrt-dirclean: linksys-shared-dirclean linksys-nvram-dirclean linksys-wlconf-dirclean
|