4 BUILD_DIR:=$(TOPDIR)/build
5 TARGET_PATH := $(TOPDIR)/utils
6 MKFS_JFFS2:=$(TOPDIR)/utils/mkfs.jffs2
7 IMAGE:=$(BUILD_DIR)/root_fs
8 TARGET_DIR:=$(TOPDIR)/root
9 SED:=PATH="$(TARGET_PATH)" sed -i -e
10 PACKAGE_DIR=$(TOPDIR)/packages
11 LINUX_IMAGE:=$(BUILD_DIR)/buildroot-kernel-image
12 IPKG:=IPKG_INSTROOT=$(TARGET_DIR) IPKG_CONF_DIR=$(BUILD_DIR)/etc $(TARGET_DIR)/bin/ipkg -force-defaults -force-depends
16 include ./include/jffs2.mk
17 include ./include/squashfs-lzma.mk
19 IMAGE_TARGETS := $(JFFS2_TARGETS) $(SQUASHFS_TARGETS)
20 TARGET_FS:=squashfs jffs2
23 $(BIN_DIR)/openwrt-wrt54g-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-4MB,$(1)).trx
24 PATH=$(TARGET_PATH) addpattern -2 -i $$< -o $$@ -g
25 $(SED) "1s,^W54S,W54G," $$@
27 $(BIN_DIR)/openwrt-wrt54gs-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-8MB,$(1)).trx
28 PATH=$(TARGET_PATH) addpattern -2 -i $$< -o $$@ -g
30 IMAGE_TARGETS += $(BIN_DIR)/openwrt-wrt54g-$(1).bin
31 IMAGE_TARGETS += $(BIN_DIR)/openwrt-wrt54gs-$(1).bin
34 $(BIN_DIR)/openwrt-motorola-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-8MB,$(1)).trx
35 PATH=$(TARGET_PATH) motorola-bin $$< $$@
37 IMAGE_TARGETS += $(BIN_DIR)/openwrt-motorola-$(1).bin
40 $(foreach fs,$(TARGET_FS),$(eval $(call IMAGE_template,$(fs))))
42 $(IMAGE_TARGETS): $(TARGET_DIR) $(BIN_DIR) packages_install
49 cp -a $(TOPDIR)/target_skeleton/* $(TARGET_DIR)/
51 $(BUILD_DIR)/etc/ipkg.conf:
52 mkdir -p $(BUILD_DIR)/etc
53 echo -e 'dest root /\noption offline_root $(TARGET_DIR)' > $@
55 packages_install: $(TARGET_DIR) $(BUILD_DIR)/etc/ipkg.conf
56 for package in $(PACKAGE_DIR)/*.ipk; do \
57 $(IPKG) install $$package; \
60 build: clean $(IMAGE_TARGETS)
62 rm -rf $(TARGET_DIR) $(BIN_DIR) $(IMAGE)-* $(BUILD_DIR)/etc