diff options
author | Nick Shipp <git@segbrk.com> | 2020-05-16 11:13:42 -0400 |
---|---|---|
committer | Nick Shipp <git@segbrk.com> | 2020-05-16 11:13:42 -0400 |
commit | 39501543deccc7b8adaf4ffd66ffa3aaa8affc5a (patch) | |
tree | a97eb45d3e4aa255ab323c0275fd8eb151d1cdce /Makefile | |
parent | 4300ce841cf0fe3379b538a1a32316f55b148aae (diff) |
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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 |