Add "make strip" target
authorH. Peter Anvin <hpa@zytor.com>
Tue, 10 May 2011 03:02:27 +0000 (20:02 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 10 May 2011 03:02:27 +0000 (20:02 -0700)
Add a "make strip" target, to make doing the official build easier.
We want the official build to have stripped binaries for size reasons,
so do it right and make it an actual build target.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Makefile
Makefile.private
extlinux/Makefile
libinstaller/Makefile
linux/Makefile
mk/syslinux.mk
mtools/Makefile
utils/Makefile

index 0f500a3..48b3420 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -98,6 +98,13 @@ installer:
 
 installer-local: $(ITARGET) $(BINFILES)
 
+strip:
+       $(MAKE) strip-local
+       set -e ; for i in $(ISUBDIRS); do $(MAKE) -C $$i strip ; done
+       -ls -l $(BOBJECTS) $(IOBJECTS)
+
+strip-local:
+
 version.gen: version version.pl
        $(PERL) version.pl $< $@ '%define < @'
 version.h: version version.pl
index 6ca0598..972abc2 100644 (file)
@@ -38,6 +38,7 @@ burn: isolinux.iso
 official:
        $(MAKE) spotless CC='$(CC) -m32'
        $(MAKE) all CC='$(CC) -m32'
+       $(MAKE) strip CC='$(CC) -m32'
        $(MAKE) dist CC='$(CC) -m32'
 
 release:
index c320f13..12213d8 100644 (file)
@@ -54,6 +54,9 @@ installer: extlinux
 extlinux: $(OBJS)
        $(CC) $(LDFLAGS) -o $@ $^
 
+strip:
+       $(STRIP) extlinux
+
 %.o: %.c
        $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
 %.i: %.c
index 2beb931..e67a468 100644 (file)
@@ -26,3 +26,5 @@ clean: tidy
 dist: tidy
 
 spotless: clean
+
+strip:
index ddc2f56..82bf111 100644 (file)
@@ -57,6 +57,9 @@ syslinux: $(OBJS)
 syslinux-nomtools: syslinux
        ln -f $< $@
 
+strip:
+       $(STRIP) syslinux syslinux-nomtools
+
 %.o: %.c
        $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
 %.i: %.c
index 5f05870..6d87187 100644 (file)
@@ -53,6 +53,7 @@ OBJCOPY  = objcopy
 AR       = ar
 NM       = nm
 RANLIB   = ranlib
+STRIP   = strip
 GZIPPROG = gzip
 XZ      = xz
 PNGTOPNM = pngtopnm
index 5d4bc15..3e172fd 100755 (executable)
@@ -37,6 +37,9 @@ installer: syslinux
 syslinux: $(OBJS)
        $(CC) $(LDFLAGS) -o $@ $^
 
+strip:
+       $(STRIP) syslinux
+
 %.o: %.c
        $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
 %.i: %.c
index 23f9a3d..acda8c0 100644 (file)
@@ -21,10 +21,13 @@ include $(MAKEDIR)/syslinux.mk
 CFLAGS   = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
 LDFLAGS  = -O2
 
-TARGETS         = mkdiskimage isohybrid gethostip memdiskfind
-TARGETS += isohybrid.pl  # about to be obsoleted
-ASIS     = keytab-lilo lss16toppm md5pass ppmtolss16 sha1pass syslinux2ansi \
-          pxelinux-options
+C_TARGETS       = isohybrid gethostip memdiskfind
+SCRIPT_TARGETS  = mkdiskimage
+SCRIPT_TARGETS += isohybrid.pl  # about to be obsoleted
+ASIS            = keytab-lilo lss16toppm md5pass ppmtolss16 sha1pass \
+                  syslinux2ansi pxelinux-options
+
+TARGETS = $(C_TARGETS) $(SCRIPT_TARGETS)
 
 ISOHDPFX = ../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin ../mbr/isohdpfx_c.bin \
           ../mbr/isohdppx.bin ../mbr/isohdppx_f.bin ../mbr/isohdppx_c.bin
@@ -70,4 +73,7 @@ install: installer
        mkdir -m 755 -p $(INSTALLROOT)$(BINDIR)
        install -m 755 $(TARGETS) $(ASIS) $(INSTALLROOT)$(BINDIR)
 
+strip:
+       $(STRIP) $(C_TARGETS)
+
 -include .*.d