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

40 lines
765 B
Makefile
Raw Normal View History

2015-06-06 08:35:18 -07:00
CC=
MKDIR=
2015-06-07 01:25:25 -07:00
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-06 08:35:18 -07:00
LFLAGS=-shared -g -ggdb
CFLAGS=--std=c99 -g -ggdb -O2 -Wall
2015-06-07 01:25:25 -07:00
RMEXTRA=
EXAMPLEBIN=
2015-06-06 08:35:18 -07:00
ifeq ($(OS),Windows_NT)
2015-06-06 08:39:59 -07:00
CC+=mingw32-gcc
MKDIR+=mkdir -p
2015-06-07 01:25:25 -07:00
RM+=rm
2015-06-06 08:39:59 -07:00
PLFLAGS+=-Wl,--out-implib,bin/libLoveToken.a
2015-06-06 17:51:37 -07:00
LIBNAME+=$(OUTDIR)/LoveToken.dll
2015-06-07 01:25:25 -07:00
RMEXTRA+=bin/libLoveToken.a
2015-06-06 08:35:18 -07:00
else
ifeq ($(shell uname -s), Linux)
2015-06-06 08:39:59 -07:00
CC+=gcc
MKDIR+=mkdir -p
2015-06-07 01:25:25 -07:00
RM+=rm
2015-06-06 08:39:59 -07:00
PCFLAGS+=-fPIC
2015-06-07 00:46:36 -07:00
LIBNAME+=$(OUTDIR)/LoveToken.so
2015-06-06 08:35:18 -07:00
endif
endif
2015-06-05 04:09:08 -07:00
all:
2015-06-06 17:51:37 -07:00
$(MKDIR) $(OUTDIR)
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $(OUTDIR)/lt.o src/lt.c
$(CC) $(LFLAGS) -o $(LIBNAME) $(OUTDIR)/lt.o $(PLFLAGS) -liconv
2015-06-07 01:25:25 -07:00
clean:
$(RM) $(LIBNAME) bin/lt.o $(RMEXTRA)
example:
$(CC) $(CFLAGS) -Isrc -Lbin -o bin/example examples/main.c -lLoveToken