Makefile (1209B)
1 .SUFFIXES: 2 MAKEFLAGS+=-rR 3 CFLAGS=-std=gnu23 -Wpedantic -Wall -Wextra -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 6 ifeq ($(origin CC),default) 7 CC=cc 8 endif 9 10 .PHONY: clean 11 12 %+run: %.bin 13 ./$< 14 15 .SECONDARY: 16 %: %.bin 17 @: 18 19 %.bin: %.c 20 ${CC} $< $(CFLAGS) $(LDFLAGS) -o $@ 21 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 $@ 22 # upx -9 $@ 23 24 micro: clean 25 ${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 26 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 27 echo "a=/tmp/I;tail -n+2 \$$0|unxz>\$$a;chmod +x \$$a;\$$a;exit" > micro.out 28 xz -zce -9 micro0 >> micro.out 29 chmod +x micro.out 30 31 clean: 32 rm -f ./*.bin