add ez-ipupdate
[openwrt.git] / openwrt / target / Makefile
1 include $(TOPDIR)/rules.mk
2
3 # Default target skeleton stuff, may be overridden
4 TARGET_SKEL_DIR=default/target_skeleton
5
6 all: install
7
8 define IMAGE_template
9 $(BIN_DIR)/openwrt-wrt54g-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-4MB,$(1)).trx
10 PATH=$(TARGET_PATH) addpattern -2 -i $$< -o $$@ -g
11 $(SED) "1s,^W54S,W54G," $$@
12
13 $(BIN_DIR)/openwrt-wrt54gs-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-8MB,$(1)).trx
14 PATH=$(TARGET_PATH) addpattern -2 -i $$< -o $$@ -g
15
16 ifeq ($(BR2_TARGET_WRT54G),y)
17 IMAGE_TARGETS += $(BIN_DIR)/openwrt-wrt54g-$(1).bin
18 endif
19 ifeq ($(BR2_TARGET_WRT54GS),y)
20 IMAGE_TARGETS += $(BIN_DIR)/openwrt-wrt54gs-$(1).bin
21 endif
22 endef
23
24 TARGET_DIRS:=
25 TARGET_FS:=
26 IMAGE_TARGETS:=
27 ifeq ($(strip $(BR2_TARGET_ROOTFS_JFFS2)),y)
28 TARGET_DIRS += jffs2
29 TARGET_FS += jffs2
30 endif
31 ifeq ($(strip $(BR2_TARGET_ROOTFS_SQUASHFS_LZMA)),y)
32 TARGET_DIRS += squashfs-lzma
33 TARGET_FS += squashfs
34 endif
35 $(foreach fs,$(TARGET_FS),$(eval $(call IMAGE_template,$(fs))))
36
37 INSTALL_TARGET_DIRS:=$(patsubst %,%-install,$(TARGET_DIRS))
38 $(INSTALL_TARGET_DIRS): image_clean $(TARGET_DIR)/etc/sysconf $(BIN_DIR)
39
40 prepare: $(patsubst %,%-prepare,$(TARGET_DIRS))
41 mkdir -p $(TARGET_DIR)
42 if [ -f "$(TARGET_SKELETON)" ] ; then \
43 zcat $(TARGET_SKELETON) | tar -C $(BUILD_DIR) -xf -; \
44 fi;
45 if [ -d "$(TARGET_SKEL_DIR)" ] ; then \
46 cp -a $(TARGET_SKEL_DIR)/* $(TARGET_DIR)/; \
47 fi;
48 mkdir -p $(TARGET_DIR)/jffs
49 mkdir -p $(TARGET_DIR)/dev
50 mkdir -p $(TARGET_DIR)/proc
51 mkdir -p $(TARGET_DIR)/tmp
52 mkdir -p $(TARGET_DIR)/lib
53 mkdir -p $(TARGET_DIR)/usr/lib
54 mkdir -p $(TARGET_DIR)/usr/bin
55 ln -sf /tmp/resolv.conf $(TARGET_DIR)/etc/resolv.conf
56 rm -rf $(TARGET_DIR)/var
57 ln -sf /tmp $(TARGET_DIR)/var
58 -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf
59 -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf
60
61 $(BIN_DIR):
62 mkdir -p $(BIN_DIR)
63
64 compile: $(patsubst %,%-compile,$(TARGET_DIRS))
65 install: utils-install $(patsubst %,%-install,$(TARGET_DIRS)) $(IMAGE_TARGETS)
66 clean: $(patsubst %,%-clean,$(TARGET_DIRS)) image_clean
67
68 image_clean:
69 rm -f $(BIN_DIR)/openwrt-*
70
71 $(TARGET_DIR)/etc/sysconf:
72 mkdir -p $(TARGET_DIR)/etc
73 -grep \^BR2_SYSCONF $(TOPDIR)/.config > $(TARGET_DIR)/etc/sysconf
74
75 %-clean:
76 $(MAKE) -C $(patsubst %-clean,%,$@) clean
77 %-prepare:
78 $(MAKE) -C $(patsubst %-prepare,%,$@) prepare
79 %-compile: %-prepare
80 $(MAKE) -C $(patsubst %-compile,%,$@) compile
81 %-install: %-compile
82 $(MAKE) -C $(patsubst %-install,%,$@) install
83
84
This page took 0.053009 seconds and 5 git commands to generate.