From 39501543deccc7b8adaf4ffd66ffa3aaa8affc5a Mon Sep 17 00:00:00 2001 From: Nick Shipp Date: Sat, 16 May 2020 11:13:42 -0400 Subject: Const police --- Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f4e0a45..d3a7999 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,24 @@ include config.mk -CC = diet -Os gcc +CC = diet -Os clang +LD = diet clang OBJ = sinit.o BIN = sinit -CFLAGS = -Os -flto -s -fno-asynchronous-unwind-tables -fno-unwind-tables -LDFLAGS = -flto -Os -static -Wl,--gc-sections -Wl,--strip-all -Wl,-z,norelro -fno-asynchronous-unwind-tables -Wl,--build-id=none +CFLAGS = -Oz -flto -fno-asynchronous-unwind-tables -fno-unwind-tables -ffunction-sections -fdata-sections +LDFLAGS = -flto -O2 -static -Wl,--gc-sections -Wl,--strip-all -Wl,-z,norelro -fno-asynchronous-unwind-tables -Wl,--build-id=none all: $(BIN) poweroff reboot +reboot: reboot.o + $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS) + strip -R .comment -R .jcr -R .eh_data -R .note -R .eh_frame $@ + +poweroff: poweroff.o + $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS) + strip -R .comment -R .jcr -R .eh_data -R .note -R .eh_frame $@ + $(BIN): $(OBJ) - $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS) + $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS) strip -R .comment -R .jcr -R .eh_data -R .note -R .eh_frame $@ $(OBJ): config.h -- cgit v1.2.3-70-g09d2