2006-07-21 12:15:06 +03: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 05:34:52 +02:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-05-16 03:32:57 +03:00
|
|
|
include $(TOPDIR)/.config
|
2006-10-14 15:18:39 +03:00
|
|
|
include $(INCLUDE_DIR)/host.mk
|
2006-05-16 03:32:57 +03:00
|
|
|
|
2007-03-16 05:02:31 +02:00
|
|
|
all: compile
|
|
|
|
|
2007-04-04 02:03:56 +03:00
|
|
|
include $(TMP_DIR)/.packagedeps
|
2007-03-16 05:02:31 +02:00
|
|
|
|
2006-10-12 20:45:22 +03:00
|
|
|
PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(prereq-y) $(prereq-m))
|
2006-07-29 14:30:06 +03:00
|
|
|
DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m))
|
2007-04-12 15:35:49 +03:00
|
|
|
COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
|
2005-07-18 01:52:59 +03:00
|
|
|
INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
|
2005-04-10 23:28:17 +03:00
|
|
|
|
2006-05-10 23:32:22 +03:00
|
|
|
$(STAMP_DIR) $(TARGET_DIR):
|
2005-07-19 03:48:36 +03:00
|
|
|
mkdir -p $@
|
|
|
|
|
2007-04-12 01:59:42 +03:00
|
|
|
ifeq ($(QUIET),1)
|
|
|
|
%-compile %-install: FORCE
|
2007-07-12 15:50:16 +03:00
|
|
|
$(MAKE) -j1 -C $* $(patsubst $*-%,%,$@) || { $(call MESSAGE, "*** $* $(patsubst $*-%,%,$@) failed"); false; }
|
2007-04-12 01:59:42 +03:00
|
|
|
|
2007-06-04 14:14:08 +03:00
|
|
|
%-prepare %-prereq %-download %-clean: FORCE
|
2007-04-12 01:59:42 +03:00
|
|
|
else
|
2007-06-04 14:14:08 +03:00
|
|
|
%-prepare %-prereq %-download %-clean %-compile %-install: FORCE
|
2007-04-12 01:59:42 +03:00
|
|
|
endif
|
2007-07-12 15:50:16 +03:00
|
|
|
$(MAKE) -j1 -C $* $(patsubst $*-%,%,$@)
|
2007-03-17 04:54:16 +02:00
|
|
|
|
2007-06-04 14:14:08 +03:00
|
|
|
%-refresh %-update:
|
|
|
|
-$(MAKE) -C $* $(patsubst $*-%,%,$@)
|
2007-06-04 14:20:03 +03:00
|
|
|
|
|
|
|
%-autorefresh:
|
|
|
|
-$(MAKE) -C $* clean refresh QUILT=1
|
2007-06-04 14:14:08 +03:00
|
|
|
|
|
|
|
|
2007-04-12 01:59:42 +03:00
|
|
|
# .IGNORE: $(COMPILE_PACKAGES)
|
2005-03-06 05:34:52 +02:00
|
|
|
|
2007-04-04 02:03:56 +03:00
|
|
|
$(TMP_DIR)/.packagedeps: $(TMP_DIR)/.packageinfo
|
2007-03-26 23:17:28 +03:00
|
|
|
@$(TOPDIR)/scripts/metadata.pl package_mk < $< > $@ || rm -f $@
|
2006-05-16 03:32:57 +03:00
|
|
|
|
2007-03-16 05:02:31 +02:00
|
|
|
preconfig:
|
2006-05-16 03:32:57 +03:00
|
|
|
clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
|
2006-07-29 14:30:06 +03:00
|
|
|
prereq: $(PREREQ_PACKAGES)
|
|
|
|
download: $(DOWNLOAD_PACKAGES)
|
2007-02-16 03:06:23 +02:00
|
|
|
compile: $(COMPILE_PACKAGES)
|
2007-06-04 14:20:03 +03:00
|
|
|
refresh: $(patsubst %,%-autorefresh,$(package-y) $(package-m) $(package-))
|
2007-01-15 01:37:40 +02:00
|
|
|
|
2006-12-20 09:00:30 +02:00
|
|
|
install-targets: $(INSTALL_PACKAGES)
|
2006-05-31 23:58:13 +03:00
|
|
|
install:
|
|
|
|
rm -rf $(BUILD_DIR)/root
|
|
|
|
$(MAKE) install-targets
|
2007-03-16 05:02:31 +02:00
|
|
|
$(MAKE) preconfig
|
2006-12-01 16:01:31 +02:00
|
|
|
@if [ -d $(TOPDIR)/files ]; then \
|
|
|
|
$(CP) $(TOPDIR)/files/. $(BUILD_DIR)/root; \
|
|
|
|
fi
|
2007-05-31 15:05:37 +03:00
|
|
|
@mkdir -p $(BUILD_DIR)/root/etc/rc.d
|
2006-10-16 00:03:30 +03: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; \
|
2007-03-16 05:02:31 +02:00
|
|
|
done || true \
|
2006-10-16 00:03:30 +03:00
|
|
|
)
|
2007-04-29 04:30:48 +03:00
|
|
|
@-find $(BUILD_DIR)/root -name CVS | $(XARGS) rm -rf
|
|
|
|
@-find $(BUILD_DIR)/root -name .svn | $(XARGS) rm -rf
|
|
|
|
@-find $(BUILD_DIR)/root -name '.#*' | $(XARGS) rm -f
|
2006-05-16 03:32:57 +03:00
|
|
|
|
2006-08-02 16:06:58 +03:00
|
|
|
index: $(PACKAGE_DIR)/Packages
|
|
|
|
|
|
|
|
$(PACKAGE_DIR)/Packages: $(PACKAGE_DIR)/*.ipk
|
2006-10-11 02:04:00 +03:00
|
|
|
(cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages)
|
2006-07-30 20:09:22 +03:00
|
|
|
|
2007-01-31 20:33:04 +02:00
|
|
|
symlinks:
|
|
|
|
../scripts/feeds.sh $(CONFIG_SOURCE_FEEDS)
|
2006-08-03 21:30:00 +03:00
|
|
|
|
2007-02-16 03:12:05 +02:00
|
|
|
ifeq ($(MAKECMDGOALS),compile)
|
2006-08-03 21:30:00 +03:00
|
|
|
MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
|
|
|
|
else
|
|
|
|
.NOTPARALLEL:
|
|
|
|
endif
|