build xfile before compiling picrin

This commit is contained in:
Yuichi Nishiwaki 2014-02-02 11:16:33 +09:00
parent 0fda7e65ad
commit cdd58c3ac9
1 changed files with 5 additions and 2 deletions

View File

@ -2,8 +2,10 @@ CC=gcc
CFLAGS=-Wall -Wextra -std=c99 CFLAGS=-Wall -Wextra -std=c99
ifeq ($(findstring CYGWIN,$(shell uname -s)), CYGWIN) ifeq ($(findstring CYGWIN,$(shell uname -s)), CYGWIN)
XFILE_LIB=cygxfile.dll
PICRIN_LIB=cygpicrin.dll PICRIN_LIB=cygpicrin.dll
else else
XFILE_LIB=libxfile.so
PICRIN_LIB=libpicrin.so PICRIN_LIB=libpicrin.so
endif endif
@ -11,6 +13,7 @@ all: deps release
deps: deps:
git submodule update --init git submodule update --init
$(CC) $(CFLAGS) -shared -fPIC extlib/xfile/*.c -o lib/$(XFILE_LIB) -I./extlib/xfile
release: CFLAGS += -DDEBUG=0 -O3 release: CFLAGS += -DDEBUG=0 -O3
release: build release: build
@ -21,13 +24,13 @@ debug: build
build: build-lib build-main build: build-lib build-main
build-main: build-main:
$(CC) $(CFLAGS) tools/main.c src/*.c -o bin/picrin -I./include -I./extlib -lreadline -lm $(CC) $(CFLAGS) tools/main.c src/*.c -o bin/picrin -I./include -I./extlib -L./extlib -lreadline -lm -lxfile
build-lib: build-lib:
cd src; \ cd src; \
yacc -d parse.y; \ yacc -d parse.y; \
flex scan.l flex scan.l
$(CC) $(CFLAGS) -shared -fPIC src/*.c -o lib/$(PICRIN_LIB) -I./include -I./extlib -lm $(CC) $(CFLAGS) -shared -fPIC src/*.c -o lib/$(PICRIN_LIB) -I./include -I./extlib -L./lib -lm -lxfile
clean: clean:
rm -f src/y.tab.c src/y.tab.h src/lex.yy.c rm -f src/y.tab.c src/y.tab.h src/lex.yy.c