mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Packaged toy as a dll
This commit is contained in:
@@ -5,13 +5,24 @@ CFLAGS +=$(addprefix -I,$(IDIR)) -g -Wall -W -pedantic -Wno-unused-parameter -Wn
|
||||
LIBS +=
|
||||
|
||||
ODIR = obj
|
||||
SRC = $(wildcard *.c)
|
||||
SRC = $(filter-out $(wildcard *main.c),$(wildcard *.c))
|
||||
OBJ = $(addprefix $(ODIR)/,$(SRC:.c=.o))
|
||||
|
||||
OUT = ../$(OUTDIR)/toy
|
||||
OUTNAME = toy
|
||||
OUT = ../$(OUTDIR)/$(OUTNAME).dll
|
||||
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
|
||||
|
||||
all: $(OBJ)
|
||||
$(CC) -o $(OUT) $^ $(CFLAGS) $(LIBS)
|
||||
REPLSRC = $(wildcard repl_main.c)
|
||||
REPLOUT = $(OUTNAME)repl.exe
|
||||
|
||||
all: library $(addprefix $(ODIR)/,$(REPLSRC:.c=.o))
|
||||
$(CC) -DTOY_IMPORT $(CFLAGS) -o ../$(OUTDIR)/$(REPLOUT) $(addprefix $(ODIR)/,$(REPLSRC:.c=.o)) $(LIBS) -L$(realpath $(shell pwd)/../$(OUTDIR)) -l$(OUTNAME)
|
||||
|
||||
library: $(OBJ)
|
||||
$(CC) -DTOY_EXPORT $(CFLAGS) -shared -o $(OUT) $(LIBLINE)
|
||||
|
||||
static: $(OBJ) $(addprefix $(ODIR)/,$(REPLSRC:.c=.o))
|
||||
$(CC) $(CFLAGS) -o ../$(OUTDIR)/$(REPLOUT) $(addprefix $(ODIR)/,$(REPLSRC:.c=.o)) $(OBJ) $(LIBS)
|
||||
|
||||
$(OBJ): | $(ODIR)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user