Skip to content

Commit

Permalink
preliminarily detect windows platforms and call -fPIC accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
HalosGhost committed Jun 9, 2019
1 parent 41f3a6d commit 147545a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 147545a

Please sign in to comment.