d58a367f123089bd0cdb839a48c13e25257e7afe
[openwrt.git] / openwrt / package / openwrt / openwrt.mk
1 #############################################################
2 #
3 # openwrt tools
4 #
5 #############################################################
6
7 OPENWRT_SITE=http://openwrt.openbsd-geek.de
8
9 # shared library
10 OPENWRT_SHARED_SOURCE=openwrt-shared.tar.gz
11 OPENWRT_SHARED_DIR=$(BUILD_DIR)/openwrt-shared
12 OPENWRT_SHARED_TARGET_BINARY:=usr/lib/libshared.so
13
14 $(DL_DIR)/$(OPENWRT_SHARED_SOURCE):
15 $(WGET) -P $(DL_DIR) $(OPENWRT_SITE)/$(OPENWRT_SHARED_SOURCE)
16
17 $(OPENWRT_SHARED_DIR)/.source: $(DL_DIR)/$(OPENWRT_SHARED_SOURCE)
18 zcat $(DL_DIR)/$(OPENWRT_SHARED_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
19 touch $(OPENWRT_SHARED_DIR)/.source
20
21 $(TARGET_DIR)/$(OPENWRT_SHARED_TARGET_BINARY): $(OPENWRT_SHARED_DIR)/.source
22 $(MAKE) -C $(OPENWRT_SHARED_DIR) -f Makefile-openwrt \
23 INSTALLDIR=$(TARGET_DIR) \
24 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
25 CFLAGS="$(TARGET_CFLAGS) -I. -I../binary/include -Wall -I$(OPENWRT_SRCBASE)/" \
26 install
27
28 openwrt-shared: $(TARGET_DIR)/$(OPENWRT_SHARED_TARGET_BINARY)
29
30 openwrt-shared-clean:
31 -$(MAKE) -C $(OPENWRT_SHARED_DIR) clean
32
33
34 # nvram tool
35 OPENWRT_NVRAM_SOURCE=openwrt-nvram.tar.gz
36 OPENWRT_NVRAM_DIR=$(BUILD_DIR)/openwrt-nvram
37 OPENWRT_NVRAM_TARGET_BINARY:=usr/sbin/nvram
38
39 $(DL_DIR)/$(OPENWRT_NVRAM_SOURCE):
40 $(WGET) -P $(DL_DIR) $(OPENWRT_SITE)/$(OPENWRT_NVRAM_SOURCE)
41
42 $(OPENWRT_NVRAM_DIR)/.source: $(DL_DIR)/$(OPENWRT_NVRAM_SOURCE)
43 zcat $(DL_DIR)/$(OPENWRT_NVRAM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
44 touch $(OPENWRT_NVRAM_DIR)/.source
45
46 $(TARGET_DIR)/$(OPENWRT_NVRAM_TARGET_BINARY): $(OPENWRT_NVRAM_DIR)/.source
47 $(MAKE) -C $(OPENWRT_NVRAM_DIR) INSTALLDIR=$(TARGET_DIR) \
48 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
49 CFLAGS="$(TARGET_CFLAGS) -I. -I../binary/include -Wall -DOPENWRT_NVRAM" \
50 install
51
52 openwrt-nvram: $(TARGET_DIR)/$(OPENWRT_NVRAM_TARGET_BINARY)
53
54 openwrt-nvram-clean:
55 -$(MAKE) -C $(OPENWRT_NVRAM_BUILD_DIR) clean
56
57 # mtd tool
58 OPENWRT_MTD_SOURCE=package/openwrt/mtd.c
59 OPENWRT_MTD_TARGET_BINARY:=sbin/mtd
60
61 $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY):
62 $(TARGET_CC) -o $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY) $(OPENWRT_MTD_SOURCE)
63
64 openwrt-mtd: $(TARGET_DIR)/$(OPENWRT_MTD_TARGET_BINARY)
65
66 # wlconf tool
67 OPENWRT_WLCONF_SOURCE=openwrt-wlconf.tar.gz
68 OPENWRT_WLCONF_DIR=$(BUILD_DIR)/openwrt-wlconf
69 OPENWRT_WLCONF_TARGET_BINARY:=usr/sbin/wlconf
70
71 $(DL_DIR)/$(OPENWRT_WLCONF_SOURCE):
72 $(WGET) -P $(DL_DIR) $(OPENWRT_SITE)/$(OPENWRT_WLCONF_SOURCE)
73
74 $(OPENWRT_WLCONF_DIR)/.source: $(DL_DIR)/$(OPENWRT_WLCONF_SOURCE)
75 zcat $(DL_DIR)/$(OPENWRT_WLCONF_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
76 touch $(OPENWRT_WLCONF_DIR)/.source
77
78 $(TARGET_DIR)/$(OPENWRT_WLCONF_TARGET_BINARY): $(OPENWRT_WLCONF_DIR)/.source
79 $(MAKE) -C $(OPENWRT_WLCONF_DIR) INSTALLDIR=$(TARGET_DIR) \
80 CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld STRIP="$(STRIP)" \
81 CFLAGS="$(TARGET_CFLAGS) -I. -I../binary/include -I$(BUILD_DIR)/openwrt-shared \
82 -I$(BUILD_DIR)/openwrt-nvram -Wall -DOPENWRT_WLCONF" \
83 LDFLAGS="-lnvram -lshared -L$(BUILD_DIR)/openwrt-shared -L$(BUILD_DIR)/openwrt-nvram" \
84 install
85
86 openwrt-wlconf: $(TARGET_DIR)/$(OPENWRT_WLCONF_TARGET_BINARY)
87
88 openwrt-wlconf-clean:
89 -$(MAKE) -C $(OPENWRT_WLCONF_BUILD_DIR) clean
90
91
92 openwrt: openwrt-shared openwrt-nvram openwrt-mtd openwrt-wlconf
93
94
This page took 0.054044 seconds and 3 git commands to generate.