X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;ds=sidebyside;f=src%2FMakefile;h=275275e2566936ff886d2f6f481e0a5825765b04;hb=b55df2367170f6f30d2d95d518626d7a2ef06333;hp=82cffb08559ae26bdac28dedf4f0e9f03c91792a;hpb=31e7fe4de0502c6065244d07ebbae7410c7da9f7;p=rrq%2Foverlay-boot.git diff --git a/src/Makefile b/src/Makefile index 82cffb0..275275e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,22 +1,14 @@ -all: reaper reaperc reapernsl +all: reaper -STRIP?=strip +# Pick compiler by preference +CCPREFS = /usr/bin/musl-gcc /usr/bin/gcc +CC = $(word 1,$(shell ls $(CCPREFS) 2>/dev/null)) -reaper: reaper.asm - fasm $^ -s $@.fas $@ - chmod a+x $@ +CFLAGS = -Wall -static -O3 -flto -reaper.map: reaper - ./fas2txt.lsp $@.fas > $@.map - -reaperc: reaper.c - $(CC) -O3 -flto -o $@ $^ - $(STRIP) $@ - -reapernsl: reaper_nsl.c - #$(CC) -O3 -flto -nostdlib -static -fdata-sections -ffunction-sections -o $@ $^ -Wl,--gc-sections -Wl,--strip-all -Wl,--build-id=none - $(CC) -O3 -flto -nostdlib -static -o $@ $^ -Wl,--build-id=none - $(STRIP) --remove-section=.comment $@ +reaper: reaper.c + $(CC) $(CFLAGS) -o $@ $^ + strip $@ clean: - rm -f reaper reaperc reaper.fas reaper.map reapernsl + rm -f reaper