Makefile 1.9 KB

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