makefile cleanup, new directory name for linksys kernel stuff
[openwrt.git] / package / openwrt / openwrt.mk
1 #############################################################
2 #
3 # linksys and openwrt tools
4 #
5 #############################################################
6
7 LINKSYS_KERNEL_INCLUDE=$(BUILD_DIR)/linksys-kernel
8
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
14
15 $(DL_DIR)/$(LINKSYS_SHARED_TGZ):
16 $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_SHARED_TGZ)
17
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
21
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." \
29 install
30
31 linksys-shared: $(TARGET_DIR)/$(LINKSYS_SHARED_TARGET_BINARY)
32
33 linksys-shared-clean:
34 -$(MAKE) -C $(LINKSYS_SHARED_DIR) clean
35
36
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
42
43 $(DL_DIR)/$(LINKSYS_NVRAM_TGZ):
44 $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_NVRAM_TGZ)
45
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
49
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
55
56 linksys-nvram: $(TARGET_DIR)/$(LINKSYS_NVRAM_TARGET_BINARY)
57
58 linksys-nvram-clean:
59 -$(MAKE) -C $(LINKSYS_NVRAM_BUILD_DIR) clean
60
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
66
67 $(DL_DIR)/$(LINKSYS_WLCONF_TGZ):
68 $(WGET) -P $(DL_DIR) $(LINKSYS_TGZ_SITE)/$(LINKSYS_WLCONF_TGZ)
69
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
73
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" \
83 install
84
85 linksys-wlconf: $(TARGET_DIR)/$(LINKSYS_WLCONF_TARGET_BINARY)
86
87 linksys-wlconf-clean:
88 -$(MAKE) -C $(LINKSYS_WLCONF_BUILD_DIR) clean
89
90
91 # mtd tool
92 OPENWRT_MTD_SOURCE=package/openwrt/mtd.c
93 OPENWRT_MTD_TARGET_BINARY:=sbin/mtd
94
95 $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY):
96 $(TARGET_CC) -o $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY) $(OPENWRT_MTD_SOURCE)
97
98 openwrt-mtd: $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
99
100 # trx tool
101 OPENWRT_TRX_SOURCE=package/openwrt/trx.c
102 OPENWRT_TRX_TARGET=$(BUILD_DIR)/trx
103
104 $(OPENWRT_TRX_TARGET):
105 $(CC) -o $(OPENWRT_TRX_TARGET) $(OPENWRT_TRX_SOURCE)
106
107 openwrt-trx: $(OPENWRT_TRX_TARGET)
108
109 # addpattern tool
110 OPENWRT_ADDPATTERN_SOURCE=package/openwrt/addpattern.c
111 OPENWRT_ADDPATTERN_TARGET=$(BUILD_DIR)/addpattern
112
113 $(OPENWRT_ADDPATTERN_TARGET):
114 $(CC) -o $(OPENWRT_ADDPATTERN_TARGET) $(OPENWRT_ADDPATTERN_SOURCE)
115
116 openwrt-addpattern: $(OPENWRT_ADDPATTERN_TARGET)
117
118 openwrt: linksys-shared linksys-nvram linksys-wlconf openwrt-mtd openwrt-trx openwrt-addpattern
119
120
This page took 0.046964 seconds and 5 git commands to generate.