Archived
1
0

better makefile

This commit is contained in:
Marrub 2015-06-06 11:35:18 -04:00
parent 4a5e2b0350
commit 611bfa9343

View File

@ -1,10 +1,23 @@
# sorry this makefile doesn't include anything cross-platform
# was hurriedly made to test it
CC=
MKDIR=
PCFLAGS=
PLFLAGS=
LFLAGS=-shared -g -ggdb
CFLAGS=--std=c99 -g -ggdb -Wall
ifeq ($(OS),Windows_NT)
CC += mingw32-gcc
MKDIR += mkdir -p
PLFLAGS += -Wl,--out-implib,bin/libLoveToken.a
else
ifeq ($(shell uname -s), Linux)
CC += gcc
MKDIR += mkdir -p
PCFLAGS += -fPIC
endif
endif
all:
mkdir -p bin
mingw32-gcc --std=c99 -g -ggdb -c -o bin/lt.o src/lt.c -liconv
mingw32-gcc -shared -g -ggdb -o bin/LoveToken.dll bin/lt.o -Wl,--out-implib,bin/libLoveToken.a -liconv
#mingw32-gcc --std=c99 -g -ggdb -c -o bin/lt.o -DI_FUCKING_HATE_WINDOWS src/lt.c
#mingw32-gcc -shared -g -ggdb -o bin/LoveToken.dll bin/iconv.o bin/lt.o -Wl,--out-implib,bin/libLoveToken.a
#cp bin/LoveToken.dll test/LoveToken.dll
$(MKDIR) bin
$(CC) $(CFLAGS) $(PCFLAGS) -c -o bin/lt.o src/lt.c
$(CC) $(LFLAGS) -o bin/LoveToken.dll bin/lt.o $(PLFLAGS) -liconv