1 include $(TOPDIR
)/rules.mk
3 # Default target skeleton stuff, may be overridden
4 TARGET_SKEL_DIR
=default
/target_skeleton
9 $(BIN_DIR
)/openwrt-wrt54g-
$(1).bin
: $(BIN_DIR
)/openwrt-brcm-2.4
-$(patsubst jffs2
,jffs2-4MB
,$(1)).trx
10 PATH
=$(TARGET_PATH
) addpattern
-2 -i
$$< -o
$$@
-g
11 $(SED
) "1s,^W54S,W54G," $$@
13 $(BIN_DIR
)/openwrt-wrt54gs-
$(1).bin
: $(BIN_DIR
)/openwrt-brcm-2.4
-$(patsubst jffs2
,jffs2-8MB
,$(1)).trx
14 PATH
=$(TARGET_PATH
) addpattern
-2 -i
$$< -o
$$@
-g
16 ifeq ($(BR2_TARGET_WRT54G
),y
)
17 IMAGE_TARGETS
+= $(BIN_DIR
)/openwrt-wrt54g-
$(1).bin
19 ifeq ($(BR2_TARGET_WRT54GS
),y
)
20 IMAGE_TARGETS
+= $(BIN_DIR
)/openwrt-wrt54gs-
$(1).bin
24 $(BIN_DIR
)/openwrt-motorola-
$(1).bin
: $(BIN_DIR
)/openwrt-brcm-2.4
-$(patsubst jffs2
,jffs2-8MB
,$(1)).trx
25 PATH
=$(TARGET_PATH
) motorola-bin
$$< $$@
27 ifeq ($(BR2_TARGET_MOTOROLA
),y
)
28 IMAGE_TARGETS
+= $(BIN_DIR
)/openwrt-motorola-
$(1).bin
35 ifeq ($(strip $(BR2_TARGET_ROOTFS_JFFS2
)),y
)
39 ifeq ($(strip $(BR2_TARGET_ROOTFS_SQUASHFS_LZMA
)),y
)
40 TARGET_DIRS
+= squashfs-lzma
43 $(foreach fs
,$(TARGET_FS
),$(eval
$(call BIN_template
,$(fs
))))
45 INSTALL_TARGET_DIRS
:=$(patsubst %,%-install,$(TARGET_DIRS
))
46 $(INSTALL_TARGET_DIRS
): image_clean
$(TARGET_DIR
)/etc
/sysconf
$(BIN_DIR
)
48 prepare
: $(patsubst %,%-prepare
,$(TARGET_DIRS
))
49 mkdir
-p
$(TARGET_DIR
)
50 if
[ -f
"$(TARGET_SKELETON)" ] ; then \
51 zcat
$(TARGET_SKELETON
) |
tar -C
$(BUILD_DIR
) -xf
-; \
53 if
[ -d
"$(TARGET_SKEL_DIR)" ] ; then \
54 cp
-a
$(TARGET_SKEL_DIR
)/* $(TARGET_DIR
)/; \
56 mkdir
-p
$(TARGET_DIR
)/jffs
57 mkdir
-p
$(TARGET_DIR
)/dev
58 mkdir
-p
$(TARGET_DIR
)/proc
59 mkdir
-p
$(TARGET_DIR
)/tmp
60 mkdir
-p
$(TARGET_DIR
)/lib
61 mkdir
-p
$(TARGET_DIR
)/usr
/lib
62 mkdir
-p
$(TARGET_DIR
)/usr
/bin
63 ln
-sf
/tmp
/resolv.conf
$(TARGET_DIR
)/etc
/resolv.conf
64 rm -rf
$(TARGET_DIR
)/var
65 ln
-sf
/tmp
$(TARGET_DIR
)/var
66 -find
$(TARGET_DIR
) -type d
-name CVS | xargs
rm -rf
67 -find
$(TARGET_DIR
) -type d
-name .svn | xargs
rm -rf
72 $(INSTALL_TARGET_DIRS
): lzma-loader-compile linux-install
73 $(IMAGE_TARGETS
): $(patsubst %,%-install,$(TARGET_DIRS
) linux
)
74 compile
: $(patsubst %,%-compile
,jffs2 lzma squashfs-lzma lzma-loader utils linux
)
75 install: utils-install lzma-install
$(patsubst %,%-install,$(TARGET_DIRS
) linux
) $(IMAGE_TARGETS
)
76 clean: $(patsubst %,%-clean,$(TARGET_DIRS
) linux
) image_clean
79 rm -f
$(BIN_DIR
)/openwrt-
*
81 $(TARGET_DIR
)/etc
/sysconf
:
82 mkdir
-p
$(TARGET_DIR
)/etc
83 -grep \^BR2_SYSCONF
$(TOPDIR
)/.config
> $(TARGET_DIR
)/etc
/sysconf
86 $(MAKE
) -C
$(patsubst %-clean,%,$@
) clean
88 $(MAKE
) -C
$(patsubst %-prepare
,%,$@
) prepare
90 $(MAKE
) -C
$(patsubst %-compile
,%,$@
) compile
92 $(MAKE
) -C
$(patsubst %-install,%,$@
) install