Archived
1
0
This repository has been archived on 2019-01-29. You can view files and clone it, but cannot push or open issues or pull requests.
LoveToken/Makefile

61 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2015-06-06 08:35:18 -07:00
CC=
LD=
MKDIR=mkdir -p
RM=rm
2015-06-06 08:35:18 -07:00
PCFLAGS=
PLFLAGS=
2015-06-06 08:45:04 -07:00
LIBNAME=
2015-06-06 17:51:37 -07:00
OUTDIR=bin
2015-06-07 01:46:35 -07:00
SRCDIR=src
LFLAGS=
CFLAGS=
2015-06-07 01:25:25 -07:00
RMEXTRA=
GDCCBUILD=OFF
EXAMPLEO=
EXAMPLEC=
2015-06-06 08:35:18 -07:00
ifeq ($(GDCCBUILD),ON)
CC+=gdcc-cc
LD+=gdcc-ld
LIBNAME+=$(OUTDIR)/LoveToken.bin
PCFLAGS+=--bc-target=ZDoom -i$(SRCDIR)
LFLAGS+=--bc-target=ZDoom
EXAMPLEC+=examples/gdcc.c
# These are completely arbitrary.
EXAMPLEO+=$(OUTDIR)/libc.ir $(OUTDIR)/libGDCC.ir $(OUTDIR)/libGDCC-c.ir $(OUTDIR)/libGDCC-ZDACS-asm.ir
2015-06-06 08:35:18 -07:00
else
EXAMPLEC+=examples/main.c
PCFLAGS+=--std=c99 -g -ggdb -O2 -Wall -c -I$(SRCDIR)
ifeq ($(OS),Windows_NT)
CC+=mingw32-gcc
LD+=mingw32-gcc
PLFLAGS+=-shared -g -ggdb
2015-06-11 07:42:06 -07:00
PLFLAGS2+=-Wl,--out-implib,$(OUTDIR)/libLoveToken.a -liconv
LIBNAME+=$(OUTDIR)/LoveToken.dll
2015-06-11 07:42:06 -07:00
RMEXTRA+=$(OUTDIR)/libLoveToken.a
else
ifeq ($(shell uname -s), Linux)
CC+=gcc
LD+=gcc
PCFLAGS+=-fPIC
PLFLAGS2+=-liconv
LIBNAME+=$(OUTDIR)/LoveToken.so
endif
2015-06-06 08:35:18 -07:00
endif
endif
2015-06-05 04:09:08 -07:00
2015-06-11 07:34:20 -07:00
all: $(OUTDIR)
$(CC) $(CFLAGS) $(PCFLAGS) -o $(OUTDIR)/lt.o $(SRCDIR)/lt.c
$(LD) $(LFLAGS) $(PLFLAGS) -o $(LIBNAME) $(OUTDIR)/lt.o $(PLFLAGS2)
2015-06-07 01:25:25 -07:00
2015-06-11 07:42:06 -07:00
$(OUTDIR):
2015-06-11 07:34:20 -07:00
$(MKDIR) $(OUTDIR)
2015-06-07 01:25:25 -07:00
clean:
2015-06-07 01:46:35 -07:00
$(RM) $(LIBNAME) $(OUTDIR)/lt.o $(RMEXTRA)
2015-06-07 01:25:25 -07:00
example: all
$(CC) $(CFLAGS) $(PCFLAGS) -o $(OUTDIR)/example.o $(EXAMPLEC)
$(LD) $(LFLAGS) -o $(OUTDIR)/example $(OUTDIR)/example.o $(EXAMPLEO) $(OUTDIR)/lt.o $(PLFLAGS2)