Archived
1
0

Added $(OUTDIR) to Makefile

This commit is contained in:
Benjamin Moir 2015-06-07 10:21:37 +09:30
parent 1355b115ae
commit 88cf4e2f37

View File

@ -3,6 +3,7 @@ MKDIR=
PCFLAGS= PCFLAGS=
PLFLAGS= PLFLAGS=
LIBNAME= LIBNAME=
OUTDIR=bin
LFLAGS=-shared -g -ggdb LFLAGS=-shared -g -ggdb
CFLAGS=--std=c99 -g -ggdb -Wall CFLAGS=--std=c99 -g -ggdb -Wall
@ -10,17 +11,17 @@ ifeq ($(OS),Windows_NT)
CC+=mingw32-gcc CC+=mingw32-gcc
MKDIR+=mkdir -p MKDIR+=mkdir -p
PLFLAGS+=-Wl,--out-implib,bin/libLoveToken.a PLFLAGS+=-Wl,--out-implib,bin/libLoveToken.a
LIBNAME+=bin/LoveToken.dll LIBNAME+=$(OUTDIR)/LoveToken.dll
else else
ifeq ($(shell uname -s), Linux) ifeq ($(shell uname -s), Linux)
CC+=gcc CC+=gcc
MKDIR+=mkdir -p MKDIR+=mkdir -p
PCFLAGS+=-fPIC PCFLAGS+=-fPIC
LIBNAME+=bin/lovetoken.so LIBNAME+=$(OUTDIR)/lovetoken.so
endif endif
endif endif
all: all:
$(MKDIR) bin $(MKDIR) $(OUTDIR)
$(CC) $(CFLAGS) $(PCFLAGS) -c -o bin/lt.o src/lt.c $(CC) $(CFLAGS) $(PCFLAGS) -c -o $(OUTDIR)/lt.o src/lt.c
$(CC) $(LFLAGS) -o $(LIBNAME) bin/lt.o $(PLFLAGS) -liconv $(CC) $(LFLAGS) -o $(LIBNAME) $(OUTDIR)/lt.o $(PLFLAGS) -liconv