preliminarily detect windows platforms and call -fPIC accordingly

This commit is contained in:
halosghost
2019-05-29 19:39:33 -05:00
parent 41f3a6de7c
commit 147545a488

View File

@@ -38,7 +38,11 @@ examples/%: $(DIST) examples/%.c $(PROJ).c
$(CC) $(CFLAGS) $(filter-out $(DIST), $^) -lm -o $(DIST)/$@
lib$(PROJ).so: $(DIST) $(PROJ).c
ifneq ($(OS),Windows_NT)
$(CC) $(CFLAGS) -fPIC -shared $(PROJ).c -o $(DIST)/lib$(PROJ).so
else
$(CC) $(CFLAGS) -shared $(PROJ).c -o $(DIST)/lib$(PROJ).so
endif
lib$(PROJ).a: $(DIST) $(PROJ).c
$(CC) $(CFLAGS) -c $(PROJ).c -o $(DIST)/$(PROJ).o