1 include $(TOPDIR
)/rules.mk
2 include $(TOPDIR
)/rules.mk
4 # Default target skeleton stuff, may be overridden
5 TARGET_SKEL_DIR
=default
/target_skeleton
10 $(BIN_DIR
)/openwrt-wrt54g-
$(1).bin
: $(BIN_DIR
)/openwrt-generic-
$(patsubst jffs2
,jffs2-4MB
,$(1)).trx
11 PATH
=$(TARGET_PATH
) addpattern
-2 -i
$$< -o
$$@
-g
12 $(SED
) "1s,^W54S,W54G," $$@
14 $(BIN_DIR
)/openwrt-wrt54gs-
$(1).bin
: $(BIN_DIR
)/openwrt-generic-
$(patsubst jffs2
,jffs2-8MB
,$(1)).trx
15 PATH
=$(TARGET_PATH
) addpattern
-2 -i
$$< -o
$$@
-g
17 ifeq ($(BR2_TARGET_WRT54G
),y
)
18 IMAGE_TARGETS
+= $(BIN_DIR
)/openwrt-wrt54g-
$(1).bin
20 ifeq ($(BR2_TARGET_WRT54GS
),y
)
21 IMAGE_TARGETS
+= $(BIN_DIR
)/openwrt-wrt54gs-
$(1).bin
28 ifeq ($(strip $(BR2_TARGET_ROOTFS_JFFS2
)),y
)
32 ifeq ($(strip $(BR2_TARGET_ROOTFS_SQUASHFS_LZMA
)),y
)
33 TARGET_DIRS
+= squashfs-lzma
36 $(foreach fs
,$(TARGET_FS
),$(eval
$(call IMAGE_template
,$(fs
))))
38 INSTALL_TARGET_DIRS
:=$(patsubst %,%-install,$(TARGET_DIRS
))
39 $(INSTALL_TARGET_DIRS
): image_clean
$(TARGET_DIR
)/etc
/sysconf
$(BIN_DIR
)
41 prepare
: $(patsubst %,%-prepare
,$(TARGET_DIRS
))
42 mkdir
-p
$(TARGET_DIR
)
43 if
[ -f
"$(TARGET_SKELETON)" ] ; then \
44 zcat
$(TARGET_SKELETON
) |
tar -C
$(BUILD_DIR
) -xf
-; \
46 if
[ -d
"$(TARGET_SKEL_DIR)" ] ; then \
47 cp
-a
$(TARGET_SKEL_DIR
)/* $(TARGET_DIR
)/; \
49 mkdir
-p
$(TARGET_DIR
)/jffs
50 mkdir
-p
$(TARGET_DIR
)/dev
51 mkdir
-p
$(TARGET_DIR
)/proc
52 mkdir
-p
$(TARGET_DIR
)/tmp
53 mkdir
-p
$(TARGET_DIR
)/lib
54 mkdir
-p
$(TARGET_DIR
)/usr
/lib
55 mkdir
-p
$(TARGET_DIR
)/usr
/bin
56 -find
$(TARGET_DIR
) -type d
-name CVS | xargs
rm -rf
57 -find
$(TARGET_DIR
) -type d
-name .svn | xargs
rm -rf
62 compile
: $(patsubst %,%-compile
,$(TARGET_DIRS
))
63 install: utils-install
$(patsubst %,%-install,$(TARGET_DIRS
)) $(IMAGE_TARGETS
)
64 clean: $(patsubst %,%-clean,$(TARGET_DIRS
)) image_clean
67 rm -f
$(BIN_DIR
)/openwrt-
*
69 $(TARGET_DIR
)/etc
/sysconf
:
70 mkdir
-p
$(TARGET_DIR
)/etc
71 -grep \^BR2_SYSCONF
$(TOPDIR
)/.config
> $(TARGET_DIR
)/etc
/sysconf
74 $(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
76 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
78 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
80 $(MAKE
) -C
$(patsubst %-install,%,$@
) install
84 # Default target skeleton stuff, may be overridden
85 TARGET_SKEL_DIR
=default
/target_skeleton
90 $(BIN_DIR
)/openwrt-wrt54g-
$(1).bin
: $(BIN_DIR
)/openwrt-generic-
$(patsubst jffs2
,jffs2-4MB
,$(1)).trx
91 PATH
=$(TARGET_PATH
) addpattern
-2 -i
$$< -o
$$@
-g
92 $(SED
) "1s,^W54S,W54G," $$@
94 $(BIN_DIR
)/openwrt-wrt54gs-
$(1).bin
: $(BIN_DIR
)/openwrt-generic-
$(patsubst jffs2
,jffs2-8MB
,$(1)).trx
95 PATH
=$(TARGET_PATH
) addpattern
-2 -i
$$< -o
$$@
-g
97 ifeq ($(BR2_TARGET_WRT54G
),y
)
98 IMAGE_TARGETS
+= $(BIN_DIR
)/openwrt-wrt54g-
$(1).bin
100 ifeq ($(BR2_TARGET_WRT54GS
),y
)
101 IMAGE_TARGETS
+= $(BIN_DIR
)/openwrt-wrt54gs-
$(1).bin
108 ifeq ($(strip $(BR2_TARGET_ROOTFS_JFFS2
)),y
)
112 ifeq ($(strip $(BR2_TARGET_ROOTFS_SQUASHFS_LZMA
)),y
)
113 TARGET_DIRS
+= squashfs-lzma
114 TARGET_FS
+= squashfs
116 $(foreach fs
,$(TARGET_FS
),$(eval
$(call IMAGE_template
,$(fs
))))
118 INSTALL_TARGET_DIRS
:=$(patsubst %,%-install,$(TARGET_DIRS
))
119 $(INSTALL_TARGET_DIRS
): image_clean
$(TARGET_DIR
)/etc
/sysconf
$(BIN_DIR
)
121 prepare
: $(patsubst %,%-prepare
,$(TARGET_DIRS
))
122 mkdir
-p
$(TARGET_DIR
)
123 if
[ -f
"$(TARGET_SKELETON)" ] ; then \
124 zcat
$(TARGET_SKELETON
) |
tar -C
$(BUILD_DIR
) -xf
-; \
126 if
[ -d
"$(TARGET_SKEL_DIR)" ] ; then \
127 cp
-a
$(TARGET_SKEL_DIR
)/* $(TARGET_DIR
)/; \
129 mkdir
-p
$(TARGET_DIR
)/jffs
130 mkdir
-p
$(TARGET_DIR
)/dev
131 mkdir
-p
$(TARGET_DIR
)/proc
132 mkdir
-p
$(TARGET_DIR
)/tmp
133 mkdir
-p
$(TARGET_DIR
)/lib
134 mkdir
-p
$(TARGET_DIR
)/usr
/lib
135 mkdir
-p
$(TARGET_DIR
)/usr
/bin
136 ln
-sf
/tmp
/resolv.conf
$(TARGET_DIR
)/etc
/resolv.conf
137 rm -rf
$(TARGET_DIR
)/var
138 ln
-sf
/tmp
$(TARGET_DIR
)/var
139 -find
$(TARGET_DIR
) -type d
-name CVS | xargs
rm -rf
140 -find
$(TARGET_DIR
) -type d
-name .svn | xargs
rm -rf
145 compile
: $(patsubst %,%-compile
,$(TARGET_DIRS
))
146 install: utils-install
$(patsubst %,%-install,$(TARGET_DIRS
)) $(IMAGE_TARGETS
)
147 clean: $(patsubst %,%-clean,$(TARGET_DIRS
)) image_clean
150 rm -f
$(BIN_DIR
)/openwrt-
*
152 $(TARGET_DIR
)/etc
/sysconf
:
153 mkdir
-p
$(TARGET_DIR
)/etc
154 -grep \^BR2_SYSCONF
$(TOPDIR
)/.config
> $(TARGET_DIR
)/etc
/sysconf
157 $(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
159 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
161 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
163 $(MAKE
) -C
$(patsubst %-install,%,$@
) install