Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Libs so #6

Merged
merged 12 commits into from
Feb 10, 2018
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ libs: ./include/rule_type.h src/parser.c src/dialect.c $(SRC_FILES) src/Makefile
cd src; $(MAKE) CC=$(CC) $@
.PHONY: libs

libs_so: ./include/rule_type.h src/parser.c src/dialect.c $(SRC_FILES) src/Makefile
cd src; $(MAKE) CC=$(CC) $@
.PHONY: libs_so

.run: cli $(GHERKIN) $(GOOD_FEATURE_FILES)
$(RUN_GHERKIN) $(GOOD_FEATURE_FILES) | jq . > /dev/null
touch .run
touch $@

./include/rule_type.h: gherkin.berp gherkin-c-rule-type.razor
mono berp/berp.exe -g gherkin.berp -t gherkin-c-rule-type.razor -o $@
Expand Down Expand Up @@ -96,3 +100,4 @@ acceptance/testdata/%.feature.source.ndjson: testdata/%.feature testdata/%.featu
mkdir -p `dirname $@`
$(RUN_GHERKIN) --no-ast --no-pickles $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.source.ndjson) <(jq "." $@)

1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.0.1
File renamed without changes.
File renamed without changes.
25 changes: 20 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
GCC_FLAGS=-c -Wall -Werror -g
CLANG_FLAGS=-c -Wall -Werror -g
GCC_FLAGS=-c -Wall -Werror -g -fPIC
CLANG_FLAGS=-c -Wall -Werror -g -fPIC
GCC_SO_FLAGS=-shared
MINGW_FLAGS=-c -Wall -Werror -g

ifeq ($(CC),i686-w64-mingw32-gcc)
CC=i686-w64-mingw32-gcc
LD=i686-w64-mingw32-gcc
CC_FLAGS=$(GCC_FLAGS)
CC_FLAGS=$(MINGW_FLAGS)
AR=i686-w64-mingw32-ar
EXT=.exe
else ifeq ($(CC),clang)
Expand All @@ -25,13 +27,22 @@ LD_LIBS=-lm
RM_CMD=rm -rf
MKDIR_CMD=mkdir -p

VERSION=$(shell cat ../VERSION)

all: \
cli \
../bin/gherkin_generate_tokens$(EXT)
cli \
../bin/gherkin_generate_tokens$(EXT) \
libs_so
.PHONY: all

cli: ../bin/gherkin$(EXT)
.PHONY: cli

libs: ../libs/libgherkin.a
.PHONY: libs

libs_so: ../libs/libgherkin.so.$(VERSION)
.PHONY: libs_so

clean:
$(RM_CMD) ../bin ../objs ../libs
Expand Down Expand Up @@ -121,6 +132,10 @@ GHERKIN_CLI_OBJS= \
$(MKDIR_CMD) $(dir $@)
$(AR) $(AR_FLAGS) $@ $(UTILITIES_OBJS) $(PARSER_OBJS) $(AST_OBJS) $(COMPILER_OBJS) $(PICKLES_OBJS) $(EVENT_OBJS)

../libs/libgherkin.so.$(VERSION): $(UTILITIES_OBJS) $(PARSER_OBJS) $(AST_OBJS) $(COMPILER_OBJS) $(PICKLES_OBJS) $(EVENT_OBJS) Makefile
$(MKDIR_CMD) $(dir $@)
$(CC) $(GCC_SO_FLAGS) $(UTILITIES_OBJS) $(PARSER_OBJS) $(AST_OBJS) $(COMPILER_OBJS) $(PICKLES_OBJS) $(EVENT_OBJS) -o $@

../bin/gherkin_generate_tokens$(EXT): ../libs/libgherkin.a $(GENERATE_TOKEN_OBJS) Makefile
$(MKDIR_CMD) $(dir $@)
$(LD) $(LD_FLAGS) $(GENERATE_TOKEN_OBJS) -L../libs/ -lgherkin $(LD_LIBS) -o $@
Expand Down