X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=src%2FMakefile;h=7567e7b84d920198faeb146e5dbf23697e2dfedc;hb=refs%2Fheads%2Fwip-libc;hp=82cffb08559ae26bdac28dedf4f0e9f03c91792a;hpb=31e7fe4de0502c6065244d07ebbae7410c7da9f7;p=rrq%2Foverlay-boot.git diff --git a/src/Makefile b/src/Makefile index 82cffb0..7567e7b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,22 +1,13 @@ -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 $@ $^ clean: - rm -f reaper reaperc reaper.fas reaper.map reapernsl + rm -f reaper