target/jffs2/blocksize.mk for setting block size (req. for wrt54g)
[openwrt.git] / package / openwrt / openwrt.mk
1 #############################################################
2 #
3 # linksys and openwrt tools
4 #
5 #############################################################
6
7 LINKSYS_TGZ_SITE=http://openwrt.openbsd-geek.de
8 LINKSYS_KERNEL_INCLUDE=$(BUILD_DIR)/linksys-kernel
9
10 # shared library stuff extracted from linksys firmware GPL sourcetree
11 # WRT54GS_3_37_2_1109_US
12 LINKSYS_SHARED_TGZ=linksys-shared.tar.gz
13 LINKSYS_SHARED_DIR=$(BUILD_DIR)/linksys-shared
14 LINKSYS_SHARED_TARGET_BINARY:=usr/lib/libshared.so
15
16 $(DL_DIR)/$(LINKSYS_SHARED_TGZ):
17 $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_SHARED_TGZ)
18
19 $(LINKSYS_SHARED_DIR)/.source: $(DL_DIR)/$(LINKSYS_SHARED_TGZ)
20 zcat $(DL_DIR)/$(LINKSYS_SHARED_TGZ) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
21 touch $(LINKSYS_SHARED_DIR)/.source
22
23 $(TARGET_DIR)/$(LINKSYS_SHARED_TARGET_BINARY): $(LINKSYS_SHARED_DIR)/.source
24 $(SED) 's/#include.*/#include <cy_conf.h>/g;' $(LINKSYS_SHARED_DIR)/utils.h
25 $(MAKE) -C $(LINKSYS_SHARED_DIR) -f Makefile-openwrt \
26 INSTALLDIR=$(TARGET_DIR) \
27 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
28 CFLAGS="$(TARGET_CFLAGS) -I$(LINKSYS_KERNEL_INCLUDE)/include \
29 -I$(LINKSYS_KERNEL_INCLUDE) -Wall -I." \
30 install
31
32 linksys-shared: $(TARGET_DIR)/$(LINKSYS_SHARED_TARGET_BINARY)
33
34 linksys-shared-clean:
35 -$(MAKE) -C $(LINKSYS_SHARED_DIR) clean
36
37 linksys-shared-dirclean:
38 rm -rf $(LINKSYS_SHARED_DIR)
39
40 # nvram tool extracted from linksys firmware GPL sourcetree
41 # WRT54GS_3_37_2_1109_US
42 LINKSYS_NVRAM_TGZ=linksys-nvram.tar.gz
43 LINKSYS_NVRAM_DIR=$(BUILD_DIR)/linksys-nvram
44 LINKSYS_NVRAM_TARGET_BINARY:=usr/sbin/nvram
45
46 $(DL_DIR)/$(LINKSYS_NVRAM_TGZ):
47 $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_NVRAM_TGZ)
48
49 $(LINKSYS_NVRAM_DIR)/.source: $(DL_DIR)/$(LINKSYS_NVRAM_TGZ)
50 zcat $(DL_DIR)/$(LINKSYS_NVRAM_TGZ) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
51 touch $(LINKSYS_NVRAM_DIR)/.source
52
53 $(TARGET_DIR)/$(LINKSYS_NVRAM_TARGET_BINARY): $(LINKSYS_NVRAM_DIR)/.source
54 $(MAKE) -C $(LINKSYS_NVRAM_DIR) INSTALLDIR=$(TARGET_DIR) \
55 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
56 CFLAGS="$(TARGET_CFLAGS) -I. -I$(LINKSYS_KERNEL_INCLUDE)/include \
57 -I$(LINKSYS_KERNEL_INCLUDE) -I$(LINKSYS_SHARED_DIR) -Wall" install
58
59 linksys-nvram: $(TARGET_DIR)/$(LINKSYS_NVRAM_TARGET_BINARY)
60
61 linksys-nvram-clean:
62 -$(MAKE) -C $(LINKSYS_NVRAM_BUILD_DIR) clean
63
64 linksys-nvram-dirclean:
65 rm -rf $(LINKSYS_NVRAM_DIR)
66
67 # wlconf tool extracted from linksys firmware GPL sourcetree
68 # WRT54GS_3_37_2_1109_US
69 LINKSYS_WLCONF_TGZ=linksys-wlconf.tar.gz
70 LINKSYS_WLCONF_DIR=$(BUILD_DIR)/linksys-wlconf
71 LINKSYS_WLCONF_TARGET_BINARY:=usr/sbin/wlconf
72
73 $(DL_DIR)/$(LINKSYS_WLCONF_TGZ):
74 $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_WLCONF_TGZ)
75
76 $(LINKSYS_WLCONF_DIR)/.source: $(DL_DIR)/$(LINKSYS_WLCONF_TGZ)
77 zcat $(DL_DIR)/$(LINKSYS_WLCONF_TGZ) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
78 touch $(LINKSYS_WLCONF_DIR)/.source
79
80 $(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY): $(LINKSYS_WLCONF_DIR)/.source
81 $(MAKE) -C $(LINKSYS_WLCONF_DIR) INSTALLDIR=$(TARGET_DIR) \
82 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
83 CFLAGS="$(TARGET_CFLAGS) -I. -I$(LINKSYS_KERNEL_INCLUDE)/include \
84 -I$(LINKSYS_KERNEL_INCLUDE) \
85 -I$(LINKSYS_SHARED_DIR) \
86 -I$(LINKSYS_NVRAM_DIR) \
87 -Wall -DOPENWRT_WLCONF" \
88 LDFLAGS="-lnvram -lshared -L$(BUILD_DIR)/linksys-shared -L$(BUILD_DIR)/linksys-nvram" \
89 install
90
91 linksys-wlconf: $(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY)
92
93 linksys-wlconf-clean:
94 -$(MAKE) -C $(LINKSYS_WLCONF_BUILD_DIR) clean
95
96 linksys-wlconf-dirclean:
97 rm -rf $(LINKSYS_WLCONF_DIR)
98
99 # mtd tool
100 OPENWRT_MTD_SOURCE=package/openwrt/mtd.c
101 OPENWRT_MTD_TARGET_BINARY:=sbin/mtd
102
103 $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY):
104 $(TARGET_CC) -o $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY) $(OPENWRT_MTD_SOURCE)
105
106 openwrt-mtd: $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
107
108 openwrt-mtd-clean:
109 rm $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
110
111 # jffs2root tool
112 OPENWRT_JFFS2ROOT_SOURCE=package/openwrt/jffs2root.c
113 OPENWRT_JFFS2ROOT_TARGET_BINARY:=sbin/jffs2root
114
115 $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY):
116 $(TARGET_CC) -o $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY) $(OPENWRT_JFFS2ROOT_SOURCE)
117
118 openwrt-jffs2root: $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY)
119
120 openwrt-jffs2root-clean:
121 rm $(TARGET_DIR)/$(OPENWRT_JFFS2ROOT_TARGET_BINARY)
122
123 # trx tool
124 OPENWRT_TRX_SOURCE=package/openwrt/trx.c
125 OPENWRT_TRX_TARGET=$(STAGING_DIR)/bin/trx
126
127 $(OPENWRT_TRX_TARGET):
128 $(CC) -o $(OPENWRT_TRX_TARGET) $(OPENWRT_TRX_SOURCE)
129
130 openwrt-trx: $(OPENWRT_TRX_TARGET)
131
132 openwrt-trx-clean:
133 rm $(OPENWRT_TRX_TARGET)
134
135 # addpattern tool
136 OPENWRT_ADDPATTERN_SOURCE=package/openwrt/addpattern.c
137 OPENWRT_ADDPATTERN_TARGET=$(STAGING_DIR)/bin/addpattern
138
139 $(OPENWRT_ADDPATTERN_TARGET):
140 $(CC) -o $(OPENWRT_ADDPATTERN_TARGET) $(OPENWRT_ADDPATTERN_SOURCE)
141
142 openwrt-addpattern: $(OPENWRT_ADDPATTERN_TARGET)
143
144 openwrt-addpattern-clean:
145 rm $(OPENWRT_ADDPATTERN_TARGET)
146
147 # sstrip tool
148 OPENWRT_SSTRIP_SOURCE=package/openwrt/sstrip.c
149 OPENWRT_SSTRIP_TARGET=$(STAGING_DIR)/bin/sstrip
150
151 $(OPENWRT_SSTRIP_TARGET):
152 $(CC) -o $(OPENWRT_SSTRIP_TARGET) $(OPENWRT_SSTRIP_SOURCE)
153
154 openwrt-sstrip: $(OPENWRT_SSTRIP_TARGET)
155
156 openwrt-sstrip-clean:
157 rm $(OPENWRT_SSTRIP_TARGET)
158
159 SSTRIP=$(OPENWRT_SSTRIP_TARGET)
160
161 linksys: linksys-shared linksys-nvram linksys-wlconf
162
163 openwrt: linksys openwrt-mtd openwrt-trx openwrt-addpattern openwrt-jffs2root openwrt-sstrip
164
165 openwrt-dirclean: linksys-shared-dirclean linksys-nvram-dirclean linksys-wlconf-dirclean
166
This page took 0.057225 seconds and 5 git commands to generate.