[package] busybox: ntpd: indefinitely try to resolve peer addresses (#10361)
[openwrt.git] / package / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 curdir:=package
9
10 -include $(TMP_DIR)/.packagedeps
11 $(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
12 ifeq ($(SDK),1)
13 $(curdir)/builddirs-install:=.
14 else
15 $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
16 $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
17 $(curdir)/builddirs-install:=. $(filter-out base-files,$(sort $(package-y))) $(filter base-files,$(package-y))
18 endif
19 ifneq ($(IGNORE_ERRORS),)
20 $(curdir)/builddirs-ignore-compile:= $(if $(filter n m y, $(IGNORE_ERRORS)),$(foreach m,$(IGNORE_ERRORS),$(package-$(subst n,,$(m)))),$(package-m) $(package-))
21 endif
22
23 $(curdir)/install:=$(curdir)/install-cleanup
24
25 $(curdir)/cleanup: $(TMP_DIR)/.build
26 - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
27 rm -rf $(TARGET_DIR) $(STAGING_DIR_ROOT)
28
29 ifdef CONFIG_USE_MKLIBS
30 define mklibs
31 rm -rf $(TMP_DIR)/mklibs-progs $(TMP_DIR)/mklibs-out
32 # first find all programs and add them to the mklibs list
33 find $(STAGING_DIR_ROOT) -type f -perm +100 -exec \
34 file -r -N -F '' {} + | \
35 awk ' /executable.*dynamically/ { print $$1 }' > $(TMP_DIR)/mklibs-progs
36 # find all loadable objects that are not regular libraries and add them to the list as well
37 find $(STAGING_DIR_ROOT) -type f -name \*.so\* -exec \
38 file -r -N -F '' {} + | \
39 awk ' /shared object/ { print $$1 }' >> $(TMP_DIR)/mklibs-progs
40 mkdir -p $(TMP_DIR)/mklibs-out
41 $(STAGING_DIR_HOST)/bin/mklibs.py -D \
42 -d $(TMP_DIR)/mklibs-out \
43 --sysroot $(STAGING_DIR_ROOT) \
44 -L /lib \
45 -L /usr/lib \
46 -L /usr/lib/ebtables \
47 --ldlib $(patsubst $(STAGING_DIR_ROOT)/%,/%,$(firstword $(wildcard \
48 $(foreach name,ld-uClibc.so.* ld-linux.so.* ld-*.so, \
49 $(STAGING_DIR_ROOT)/lib/$(name) \
50 )))) \
51 --target $(REAL_GNU_TARGET_NAME) \
52 `cat $(TMP_DIR)/mklibs-progs` 2>&1
53 $(RSTRIP) $(TMP_DIR)/mklibs-out
54 for lib in `ls $(TMP_DIR)/mklibs-out/*.so.* 2>/dev/null`; do \
55 LIB="$${lib##*/}"; \
56 DEST="`ls "$(TARGET_DIR)/lib/$$LIB" "$(TARGET_DIR)/usr/lib/$$LIB" 2>/dev/null`"; \
57 [ -n "$$DEST" ] || continue; \
58 echo "Copying stripped library $$lib to $$DEST"; \
59 cp "$$lib" "$$DEST" || exit 1; \
60 done
61 endef
62 endif
63
64 $(curdir)/rootfs-prepare: $(TMP_DIR)/.build
65 @-$(MAKE) package/preconfig
66 @if [ -d $(TOPDIR)/files ]; then \
67 ( cd $(TOPDIR)/files; find -type f ) | \
68 ( cd $(TARGET_DIR); while :; do \
69 read FILE; \
70 [ -z "$$FILE" ] && break; \
71 [ -L "$$FILE" ] || continue; \
72 echo "Removing symlink $(TARGET_DIR)/$$FILE"; \
73 rm -f "$$FILE"; \
74 done; ); \
75 $(CP) $(TOPDIR)/files/. $(TARGET_DIR); \
76 fi
77 @mkdir -p $(TARGET_DIR)/etc/rc.d
78 @( \
79 cd $(TARGET_DIR); \
80 for script in ./etc/init.d/*; do \
81 grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
82 IPKG_INSTROOT=$(TARGET_DIR) $$(which bash) ./etc/rc.common $$script enable; \
83 done || true \
84 )
85 @-find $(TARGET_DIR) -name CVS | $(XARGS) rm -rf
86 @-find $(TARGET_DIR) -name .svn | $(XARGS) rm -rf
87 @-find $(TARGET_DIR) -name '.#*' | $(XARGS) rm -f
88 rm -f $(TARGET_DIR)/usr/lib/opkg/info/*.postinst
89 $(if $(CONFIG_CLEAN_IPKG),rm -rf $(TARGET_DIR)/usr/lib/opkg)
90 $(call mklibs)
91
92 $(curdir)/index: FORCE
93 @(cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages && \
94 gzip -9c Packages > Packages.gz \
95 )
96
97 $(curdir)/flags-install:= -j1
98
99 $(eval $(call stampfile,$(curdir),package,prereq,.config))
100 $(eval $(call stampfile,$(curdir),package,cleanup,$(TMP_DIR)/.build))
101 $(eval $(call stampfile,$(curdir),package,compile,$(TMP_DIR)/.build))
102 $(eval $(call stampfile,$(curdir),package,install,$(TMP_DIR)/.build))
103 $(eval $(call stampfile,$(curdir),package,rootfs-prepare,$(TMP_DIR)/.build))
104
105 $(eval $(call subdir,$(curdir)))
This page took 0.046808 seconds and 5 git commands to generate.