Merge branch 'master' of github.com:ktakashi/picrin into ktakashi-master

Conflicts:
	Makefile
This commit is contained in:
Yuichi Nishiwaki 2013-11-08 00:44:55 +09:00
commit 09fc4b018e
1 changed files with 14 additions and 2 deletions

View File

@ -1,8 +1,19 @@
CC=gcc CC=gcc
CFLAGS=-Wall -O3 CFLAGS=-Wall -O3
UNAME_S := $(shell uname -s)
SO_PREFIX=lib
SO_EXT=.so
ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
SO_PREFIX=cyg
SO_EXT=.dll
endif
PICRIN_LIB=$(SO_PREFIX)picrin$(SO_EXT)
all: build-debug run all: build-debug run
release: CFLAGS += -DDEBUG=0
release: build release: build
build-debug: CFLAGS += -g -DDEBUG=1 build-debug: CFLAGS += -g -DDEBUG=1
@ -12,16 +23,17 @@ build: build-lib build-main
build-main: build-main:
$(CC) $(CFLAGS) tools/main.c -o bin/picrin -I./include -L./lib -lpicrin -lreadline $(CC) $(CFLAGS) tools/main.c -o bin/picrin -I./include -L./lib -lpicrin -lreadline
cp lib/$(PICRIN_LIB) bin/
build-lib: build-lib:
cd src; \ cd src; \
yacc -d parse.y; \ yacc -d parse.y; \
lex scan.l lex scan.l
$(CC) $(CFLAGS) -shared src/*.c -o lib/libpicrin.so -I./include -I./extlib -lm $(CC) $(CFLAGS) -shared src/*.c -o lib/$(PICRIN_LIB) -I./include -I./extlib -lm
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
rm -f lib/libpicrin.so rm -f lib/$(PICRIN_LIB)
rm -f bin/picrin rm -f bin/picrin
run: run: