Commit 32faf351 authored by Peter Korsgaard's avatar Peter Korsgaard
Browse files

Makefile: add target-finalize for common filesystem cleanup

And remove from each rootfs variant.
parent f276b269
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ endif

include package/*/*.mk

TARGETS+=target-devfiles
TARGETS+=target-finalize

ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
TARGETS+=target-purgelocales
@@ -343,7 +343,7 @@ $(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root
erase-fakeroots:
	rm -f $(PROJECT_BUILD_DIR)/.fakeroot*

target-devfiles:
target-finalize:
ifeq ($(BR2_HAVE_DEVFILES),y)
	( scripts/copy.sh $(STAGING_DIR) $(TARGET_DIR) )
else
@@ -351,6 +351,14 @@ else
	find $(TARGET_DIR)/lib \( -name '*.a' -o -name '*.la' \) -delete
	find $(TARGET_DIR)/usr/lib \( -name '*.a' -o -name '*.la' \) -delete
endif
ifneq ($(BR2_HAVE_MANPAGES),y)
	rm -rf $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/man
endif
ifneq ($(BR2_HAVE_INFOPAGES),y)
	rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/share/info
endif
	find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
	$(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null

ifeq ($(BR2_ENABLE_LOCALE_PURGE),y)
LOCALE_WHITELIST=$(PROJECT_BUILD_DIR)/locales.nopurge
+0 −11
Original line number Diff line number Diff line
@@ -63,17 +63,6 @@ cloop-module: $(CLOOP_DIR)/cloop.o
### Note: target/default/device_table.txt is not yet supported! ck
# the quickfix is to use sudo to mount the previous created cramroot
check-tools:
ifneq ($(BR2_HAVE_MANPAGES),y)
	@rm -rf $(TARGET_DIR)/usr/man
	@rm -rf $(TARGET_DIR)/usr/share/man
endif
ifneq ($(BR2_HAVE_INFOPAGES),y)
	@rm -rf $(TARGET_DIR)/usr/info
	@rm -rf $(TARGET_DIR)/usr/share/info
endif
	@rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share
	which mkisofs
	-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
	- which symlinks && symlinks -r $(TARGET_DIR)

$(IMAGE).cramfs: cramfsroot
+0 −8
Original line number Diff line number Diff line
@@ -40,14 +40,6 @@ cpioroot-init:
	ln -s sbin/init $(TARGET_DIR)/init

$(CPIO_BASE): host-fakeroot makedevs cpioroot-init
	-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
ifneq ($(BR2_HAVE_MANPAGES),y)
	@rm -rf $(TARGET_DIR)/usr/man
endif
ifneq ($(BR2_HAVE_INFOPAGES),y)
	@rm -rf $(TARGET_DIR)/usr/info
endif
	$(if $(TARGET_LDCONFIG),test -x $(TARGET_LDCONFIG) && $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null)
	# Use fakeroot to pretend all target binaries are owned by root
	rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(CPIO_BASE))
	touch $(PROJECT_BUILD_DIR)/.fakeroot.00000
+0 −9
Original line number Diff line number Diff line
@@ -52,15 +52,6 @@ endif
CRAMFS_TARGET=$(IMAGE).cramfs

cramfsroot: host-fakeroot makedevs cramfs
	#-@find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIPCMD) --strip-unneeded 2>/dev/null || true
	-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
ifneq ($(BR2_HAVE_MANPAGES),y)
	@rm -rf $(TARGET_DIR)/usr/man
endif
ifneq ($(BR2_HAVE_INFOPAGES),y)
	@rm -rf $(TARGET_DIR)/usr/info
endif
	$(if $(TARGET_LDCONFIG),test -x $(TARGET_LDCONFIG) && $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null)
	# Use fakeroot to pretend all target binaries are owned by root
	rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(CRAMFS_TARGET))
	touch $(PROJECT_BUILD_DIR)/.fakeroot.00000
+0 −12
Original line number Diff line number Diff line
@@ -87,18 +87,6 @@ EXT2_TARGET := $(EXT2_BASE)
endif

$(EXT2_BASE): host-fakeroot makedevs genext2fs
	-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
ifneq ($(BR2_HAVE_MANPAGES),y)
	@rm -rf $(TARGET_DIR)/usr/man
	@rm -rf $(TARGET_DIR)/usr/share/man
endif
ifneq ($(BR2_HAVE_INFOPAGES),y)
	@rm -rf $(TARGET_DIR)/usr/info
endif
	@test -d $(TARGET_DIR)/usr/share && \
		rmdir -p --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share || \
		true
	$(if $(TARGET_LDCONFIG),test -x $(TARGET_LDCONFIG) && $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null)
	# Use fakeroot to pretend all target binaries are owned by root
	rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(EXT2_TARGET))
	touch $(PROJECT_BUILD_DIR)/.fakeroot.00000
Loading