This commit is contained in:
2022-09-11 09:12:12 +01:00
parent acb5cc90a9
commit 2d171dd664

View File

@@ -8,20 +8,19 @@ ODIR = obj
SRC = $(filter-out $(wildcard *main.c),$(wildcard *.c)) SRC = $(filter-out $(wildcard *main.c),$(wildcard *.c))
OBJ = $(addprefix $(ODIR)/,$(SRC:.c=.o)) OBJ = $(addprefix $(ODIR)/,$(SRC:.c=.o))
OUTNAME = toy OUTNAME=toy
OUT = ../$(OUTDIR)/$(OUTNAME)
ifeq ($(findstring CYGWIN, $(shell uname)),CYGWIN) ifeq ($(findstring CYGWIN, $(shell uname)),CYGWIN)
LIBLINE =-Wl,--out-implib=../$(OUTDIR)/lib$(OUTNAME).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive $(OBJ) -Wl,--no-whole-archive LIBLINE =-Wl,--out-implib=../$(OUTDIR)/lib$(OUTNAME).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive $(OBJ) -Wl,--no-whole-archive
OUT +=.dll OUT=../$(OUTDIR)/$(OUTNAME).dll
else ifeq ($(shell uname),Linux) else ifeq ($(shell uname),Linux)
#I can't get this working as a shared lib #I can't get this working as a shared lib
LIBLINE=-Wl,--out-implib=../$(OUTDIR)/lib$(OUTNAME).a -Wl,--whole-archive $(OBJ) -Wl,--no-whole-archive LIBLINE=-Wl,--out-implib=../$(OUTDIR)/lib$(OUTNAME).a -Wl,--whole-archive $(OBJ) -Wl,--no-whole-archive
OUT = ../$(OUTDIR)/$(OUTNAME) OUT=../$(OUTDIR)/$(OUTNAME)
CFLAGS += -fPIC CFLAGS += -fPIC
else ifeq ($(OS),Windows_NT) else ifeq ($(OS),Windows_NT)
LIBLINE =-Wl,--out-implib=../$(OUTDIR)/lib$(OUTNAME).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive $(OBJ) -Wl,--no-whole-archive LIBLINE =-Wl,--out-implib=../$(OUTDIR)/lib$(OUTNAME).dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive $(OBJ) -Wl,--no-whole-archive
OUT +=.dll OUT=../$(OUTDIR)/$(OUTNAME).dll
else else
@echo "Platform test failed - what platform is this?" @echo "Platform test failed - what platform is this?"
exit 1 exit 1