kumquat-buildroot/toolchain/sstrip/sstrip.mk
Peter Korsgaard 3be4968343 Optimize (-O2) host binaries by default
Default HOST_CFLAGS to -O2, so host tools (like the cross compiler) are
built with optimization by default.

Based on a patch by Will Newton <will.newton@gmail.com>.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-10-29 21:00:26 +02:00

71 lines
1.8 KiB
Makefile

######################################################################
#
# sstrip
#
######################################################################
SSTRIP_SOURCE_FILE:=$(TOPDIR)/toolchain/sstrip/sstrip.c
######################################################################
#
# sstrip host
#
######################################################################
SSTRIP_HOST:=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-sstrip
$(SSTRIP_HOST): $(SSTRIP_SOURCE_FILE)
mkdir -p $(@D) $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin
$(HOSTCC) $(HOST_CFLAGS) $(SSTRIP_SOURCE_FILE) -o $(SSTRIP_HOST)
ln -snf ../../bin/$(REAL_GNU_TARGET_NAME)-sstrip \
$(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/sstrip
ln -snf $(REAL_GNU_TARGET_NAME)-sstrip \
$(STAGING_DIR)/usr/bin/$(GNU_TARGET_NAME)-sstrip
sstrip_host: $(SSTRIP_HOST)
sstrip_host-source: $(SSTRIP_SOURCE_FILE)
sstrip_host-clean:
rm -f $(SSTRIP_HOST)
rm -f $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/sstrip
rm -f $(STAGING_DIR)/usr/bin/$(GNU_TARGET_NAME)-sstrip
sstrip_host-dirclean:
true
######################################################################
#
# sstrip target
#
######################################################################
SSTRIP_TARGET:=$(TARGET_DIR)/usr/bin/sstrip
$(SSTRIP_TARGET): $(SSTRIP_SOURCE_FILE)
$(TARGET_CC) $(TARGET_CFLAGS) $(SSTRIP_SOURCE_FILE) -o $(SSTRIP_TARGET)
sstrip_target: $(SSTRIP_TARGET)
sstrip_target-source: $(SSTRIP_SOURCE_FILE)
sstrip_target-clean:
rm -f $(SSTRIP_TARGET)
sstrip_target-dirclean:
true
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_SSTRIP_HOST),y)
TARGETS+=sstrip_host
endif
ifeq ($(BR2_PACKAGE_SSTRIP_TARGET),y)
TARGETS+=sstrip_target
endif