From: Niki Roo Date: Sun, 15 May 2022 16:48:27 +0000 (+0200) Subject: MacOS user reported a bad fopen mode, try 2 to fix it X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=7bc269035810face45233466b3c08d6af70a5ba3;p=nsub.git MacOS user reported a bad fopen mode, try 2 to fix it --- diff --git a/src/nsub.d b/src/nsub.d index a76b265..57aa2ce 100644 --- a/src/nsub.d +++ b/src/nsub.d @@ -31,8 +31,10 @@ HEADERS=$(wildcard nsub/*.h) ## $(CC) $(CFLAGS) $^ -o $@ ## Quicker: -../bin/nsub: $(SOURCES) $(HEADERS) ../bin/libutils.o - $(CC) $(CFLAGS) $^ -o $@ +../bin/nsub: $(SOURCES) $(HEADERS) + # In two steps, so it works with clang, too + $(CC) $(CFLAGS) $^ -c && mv *.o nsub/ + $(CC) nsub/*.o ../bin/libutils.o -o $@ && rm -f nsub/*.o nsub/*.h.gch clean: rm -f nsub/*.o diff --git a/src/utils.d b/src/utils.d index 80f6fa5..15a45e2 100644 --- a/src/utils.d +++ b/src/utils.d @@ -26,7 +26,8 @@ utils/desktop.o: utils/desktop.[ch] utils/array.h ../bin/libutils.o: $(OBJECTS) mkdir -p ../bin - $(LD) --relocatable $(OBJECTS) -o $@ + # note: -r = --relocatable, but former also works with Clang + $(LD) -r $(OBJECTS) -o $@ clean: rm -f utils/*.o