Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # Copyright (C) 2006-2007 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id$
  8. curdir:=package
  9. -include $(TMP_DIR)/.packagedeps
  10. $(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
  11. ifeq ($(SDK),1)
  12. $(curdir)/builddirs-install:=.
  13. else
  14. $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
  15. $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
  16. $(curdir)/builddirs-install:=. $(sort $(package-y))
  17. endif
  18. ifneq ($(IGNORE_ERRORS),)
  19. $(curdir)/builddirs-ignore-compile:= $(if $(filter m y, $(IGNORE_ERRORS)),$(foreach m,$(IGNORE_ERRORS),$(package-$(m))),$(package-m))
  20. endif
  21. $(curdir)/install:=$(curdir)/install-cleanup
  22. $(curdir)/cleanup: $(TMP_DIR)/.build
  23. rm -rf $(TARGET_DIR)
  24. $(curdir)/rootfs-prepare: $(TMP_DIR)/.build
  25. @-$(MAKE) package/preconfig
  26. @if [ -d $(TOPDIR)/files ]; then \
  27. $(CP) $(TOPDIR)/files/. $(TARGET_DIR); \
  28. fi
  29. @mkdir -p $(TARGET_DIR)/etc/rc.d
  30. @( \
  31. cd $(TARGET_DIR); \
  32. for script in ./etc/init.d/*; do \
  33. grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
  34. IPKG_INSTROOT=$(TARGET_DIR) $(which bash) ./etc/rc.common $$script enable; \
  35. done || true \
  36. )
  37. @-find $(TARGET_DIR) -name CVS | $(XARGS) rm -rf
  38. @-find $(TARGET_DIR) -name .svn | $(XARGS) rm -rf
  39. @-find $(TARGET_DIR) -name '.#*' | $(XARGS) rm -f
  40. $(if $(CONFIG_CLEAN_IPKG),rm -rf $(TARGET_DIR)/usr/lib/ipkg)
  41. $(curdir)/index: FORCE
  42. @(cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages)
  43. $(curdir)/flags-install:= -j1
  44. $(eval $(call stampfile,$(curdir),package,prereq,.config))
  45. $(eval $(call stampfile,$(curdir),package,cleanup,$(TMP_DIR)/.build))
  46. $(eval $(call stampfile,$(curdir),package,compile,$(TMP_DIR)/.build))
  47. $(eval $(call stampfile,$(curdir),package,install,$(TMP_DIR)/.build))
  48. $(eval $(call stampfile,$(curdir),package,rootfs-prepare,$(TMP_DIR)/.build))
  49. $(eval $(call subdir,$(curdir)))