2006-07-21 11:15:06 +02:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
|
2005-03-06 04:34:52 +01:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-05-16 02:32:57 +02:00
|
|
|
include $(TOPDIR)/.config
|
2006-11-12 02:38:24 +01:00
|
|
|
include $(TMP_DIR)/.pkgdeps
|
2006-10-14 14:18:39 +02:00
|
|
|
include $(INCLUDE_DIR)/host.mk
|
2006-05-16 02:32:57 +02:00
|
|
|
|
2006-10-12 19:45:22 +02:00
|
|
|
PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(prereq-y) $(prereq-m))
|
2006-07-29 13:30:06 +02:00
|
|
|
DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m))
|
2005-07-18 00:52:59 +02:00
|
|
|
COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
|
|
|
|
INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
|
2005-04-10 22:28:17 +02:00
|
|
|
|
2006-05-10 22:32:22 +02:00
|
|
|
$(STAMP_DIR) $(TARGET_DIR):
|
2005-07-19 02:48:36 +02:00
|
|
|
mkdir -p $@
|
|
|
|
|
2006-07-29 13:30:06 +02:00
|
|
|
%-prereq: $(STAMP_DIR) $(TARGET_DIR)
|
2006-08-03 20:30:00 +02:00
|
|
|
$(MAKE) -C $(patsubst %-prereq,%,$@) prereq
|
2006-07-29 13:30:06 +02:00
|
|
|
|
2006-07-20 19:28:05 +02:00
|
|
|
%-download: $(STAMP_DIR) $(TARGET_DIR)
|
2006-08-03 20:30:00 +02:00
|
|
|
$(MAKE) -C $(patsubst %-download,%,$@) download
|
2006-06-21 01:40:02 +02:00
|
|
|
|
2005-10-22 02:06:20 +02:00
|
|
|
%-prepare: $(STAMP_DIR) $(TARGET_DIR)
|
2006-08-03 20:30:00 +02:00
|
|
|
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2006-05-10 22:32:22 +02:00
|
|
|
%-compile: $(STAMP_DIR) $(TARGET_DIR)
|
2006-08-03 20:30:00 +02:00
|
|
|
$(MAKE) -C $(patsubst %-compile,%,$@) compile
|
2005-06-05 16:45:48 +02:00
|
|
|
|
2006-05-31 22:00:21 +02:00
|
|
|
%-install: $(STAMP_DIR) $(TARGET_DIR)
|
2006-08-03 20:30:00 +02:00
|
|
|
$(MAKE) -C $(patsubst %-install,%,$@) install
|
2006-05-31 22:00:21 +02:00
|
|
|
|
2006-05-10 22:32:22 +02:00
|
|
|
%-clean: $(STAMP_DIR) $(TARGET_DIR)
|
2006-08-03 20:30:00 +02:00
|
|
|
$(MAKE) -C $(patsubst %-clean,%,$@) clean
|
2005-03-06 04:34:52 +01:00
|
|
|
|
2006-06-21 05:17:13 +02:00
|
|
|
ifeq ($(SDK),1)
|
|
|
|
GENDEP_OPTS := -s
|
|
|
|
endif
|
2006-05-16 02:32:57 +02:00
|
|
|
|
2006-11-12 02:38:24 +01:00
|
|
|
$(TMP_DIR)/.pkgdeps: $(TMP_DIR)/.pkginfo
|
2006-06-21 05:17:13 +02:00
|
|
|
@$(TOPDIR)/scripts/gen_deps.pl $(GENDEP_OPTS) < $< > $@ || rm -f $@
|
2006-05-16 02:32:57 +02:00
|
|
|
|
|
|
|
all: compile
|
|
|
|
clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
|
2006-07-29 13:30:06 +02:00
|
|
|
prereq: $(PREREQ_PACKAGES)
|
|
|
|
download: $(DOWNLOAD_PACKAGES)
|
2006-05-31 22:58:13 +02:00
|
|
|
compile-targets: $(COMPILE_PACKAGES)
|
|
|
|
compile:
|
2006-08-03 20:30:00 +02:00
|
|
|
$(MAKE) compile-targets
|
2006-05-31 22:58:13 +02:00
|
|
|
install-targets: base-files-install $(INSTALL_PACKAGES)
|
|
|
|
install:
|
|
|
|
rm -rf $(BUILD_DIR)/root
|
|
|
|
$(MAKE) install-targets
|
2006-12-01 15:01:31 +01:00
|
|
|
@if [ -d $(TOPDIR)/files ]; then \
|
|
|
|
$(CP) $(TOPDIR)/files/. $(BUILD_DIR)/root; \
|
|
|
|
fi
|
2006-10-15 23:03:30 +02:00
|
|
|
@( \
|
|
|
|
cd $(BUILD_DIR)/root; \
|
|
|
|
for script in ./etc/init.d/*; do \
|
|
|
|
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
|
|
|
|
IPKG_INSTROOT=$(BUILD_DIR)/root $(which bash) ./etc/rc.common $$script enable; \
|
|
|
|
done; \
|
|
|
|
)
|
2006-05-16 02:32:57 +02:00
|
|
|
|
2006-08-02 15:06:58 +02:00
|
|
|
index: $(PACKAGE_DIR)/Packages
|
|
|
|
|
|
|
|
$(PACKAGE_DIR)/Packages: $(PACKAGE_DIR)/*.ipk
|
2006-10-11 01:04:00 +02:00
|
|
|
(cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages)
|
2006-07-30 19:09:22 +02:00
|
|
|
|
2006-08-03 20:30:00 +02:00
|
|
|
|
|
|
|
ifeq ($(MAKECMDGOALS),compile-targets)
|
|
|
|
MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
|
|
|
|
else
|
|
|
|
.NOTPARALLEL:
|
|
|
|
endif
|