Makefile (1159B)
1 .SUFFIXES: 2 MAKEFLAGS+=-rR 3 CFLAGS=-std=gnu23 -Wpedantic -Wunused -Os -s -fomit-frame-pointer -ffast-math -fno-stack-protector -march=native -fwrapv -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-unwind-tables -fmerge-all-constants -fno-ident 4 LDFLAGS=-lm -lGL -lGLU -lX11 -Wl,--gc-sections 5 CC=cc 6 7 .PHONY: clean 8 9 %+run: %.bin 10 ./$< 11 12 .SECONDARY: 13 %: %.bin 14 @: 15 16 %.bin: %.c 17 ${CC} $< $(CFLAGS) $(LDFLAGS) -o $@ 18 strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag $@ 19 upx -9 $@ 20 21 micro: clean 22 ${CC} -Os -s -fomit-frame-pointer -nostdlib micro.c -o micro0 -Wl,-dynamic-linker,/usr/lib64/ld-linux-x86-64.so.2 -Wl,--no-as-needed /usr/lib64/libdl.so.2 /usr/lib64/libc.so 23 strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag micro0 24 echo "a=/tmp/I;tail -n+2 \$$0|unxz>\$$a;chmod +x \$$a;\$$a;exit" > micro.out 25 xz -zce -9 micro0 >> micro.out 26 chmod +x micro.out 27 28 clean: 29 rm -f ./*.bin