fix sdk
[openwrt.git] / package / sdk / files / Makefile.ib
1 # OpenWrt SDK Makefile
2 TOPDIR:=${shell pwd}
3 BIN_DIR:=$(TOPDIR)/bin
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
13
14 all: build
15
16 include ./include/jffs2.mk
17 include ./include/squashfs-lzma.mk
18
19 IMAGE_TARGETS := $(JFFS2_TARGETS) $(SQUASHFS_TARGETS)
20 TARGET_FS:=squashfs jffs2
21
22 define IMAGE_template
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," $$@
26
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
29
30 IMAGE_TARGETS += $(BIN_DIR)/openwrt-wrt54g-$(1).bin
31 IMAGE_TARGETS += $(BIN_DIR)/openwrt-wrt54gs-$(1).bin
32
33
34 $(BIN_DIR)/openwrt-motorola-$(1).bin: $(BIN_DIR)/openwrt-generic-$(patsubst jffs2,jffs2-8MB,$(1)).trx
35 PATH=$(TARGET_PATH) motorola-bin $$< $$@
36
37 IMAGE_TARGETS += $(BIN_DIR)/openwrt-motorola-$(1).bin
38 endef
39
40 $(foreach fs,$(TARGET_FS),$(eval $(call IMAGE_template,$(fs))))
41
42 $(IMAGE_TARGETS): $(TARGET_DIR) $(BIN_DIR) packages_install
43
44 $(BIN_DIR):
45 mkdir -p $@
46
47 $(TARGET_DIR):
48 mkdir -p $@
49 cp -a $(TOPDIR)/target_skeleton/* $(TARGET_DIR)/
50
51 $(BUILD_DIR)/etc/ipkg.conf:
52 mkdir -p $(BUILD_DIR)/etc
53 echo -e 'dest root /\noption offline_root $(TARGET_DIR)' > $@
54
55 packages_install: $(TARGET_DIR) $(BUILD_DIR)/etc/ipkg.conf
56 for package in $(PACKAGE_DIR)/*.ipk; do \
57 $(IPKG) install $$package; \
58 done
59
60 build: clean $(IMAGE_TARGETS)
61 clean:
62 rm -rf $(TARGET_DIR) $(BIN_DIR) $(IMAGE)-* $(BUILD_DIR)/etc
This page took 0.043702 seconds and 5 git commands to generate.