MacOS user reported a bad fopen mode, try 2 to fix it
authorNiki Roo <niki@nikiroo.be>
Sun, 15 May 2022 16:48:27 +0000 (18:48 +0200)
committerNiki Roo <niki@nikiroo.be>
Sun, 15 May 2022 16:48:27 +0000 (18:48 +0200)
src/nsub.d
src/utils.d

index a76b265a7838a9cf15982183ad9dcca043779605..57aa2ce126bd9d45050c8ad13999a56307545a78 100644 (file)
@@ -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
index 80f6fa556e4b46d760b0f9c18be12fda6385a129..15a45e22b699a5a417d060f91ed7b16b648fc40e 100644 (file)
@@ -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