Poincare: Build and use the rulegen

Change-Id: I4971102cc2267b2c9c010c20f18f70be5fb85c52
This commit is contained in:
Romain Goyet
2016-04-01 14:28:45 +02:00
parent f54403ae21
commit 9993ba1d77
2 changed files with 9 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
SFLAGS += -Ipoincare/include
include poincare/src/simplify/rules_generation/Makefile
include poincare/src/simplify/Makefile
objs += $(addprefix poincare/src/,\
addition.o\
@@ -30,14 +30,7 @@ objs += $(addprefix poincare/src/layout/,\
horizontal_layout.o\
string_layout.o\
)
objs += $(addprefix poincare/src/simplify/,\
expression_builder.o\
expression_match.o\
expression_selector.o\
simplification.o\
simplification_generator.o\
simplification_rules.o\
)
tests += $(addprefix poincare/test/,\
addition.cpp\
fraction.cpp\

View File

@@ -11,15 +11,15 @@ rulegen_objs := $(addprefix $(dir)/,\
$(dir)/rules_parser.cpp: $(dir)/rules_parser.y
@echo "BISON $@"
bison --defines=$(dir)/rules_tokens.h $< -o $@
bison --defines=poincare/src/simplify/rules_generation/rules_tokens.h $< -o $@
$(dir)/rules_lexer.cpp: $(dir)/rules_lexer.l $(dir)/rules_parser.cpp
@echo "FLEX $@"
flex -o $@ $<
rulegen := $(dir)/rulegen
RULEGEN := $(dir)/rulegen
products += $(rulegen_objs) $(rulegen) $(addprefix $(dir)/,\
products += $(rulegen_objs) $(RULEGEN) $(addprefix $(dir)/,\
rules_tokens.h\
rules_parser.cpp\
rules_lexer.cpp\
@@ -32,15 +32,8 @@ HOSTCXX = clang++
$(rulegen_objs): %.o: %.cpp
@echo "HOSTCC $@"
$(HOSTCXX) $(GENERATOR_CXXFLAGS) -c $< -o $@
@$(HOSTCXX) $(GENERATOR_CXXFLAGS) -c $< -o $@
$(rulegen): $(rulegen_objs)
# Now let's use the rulegen
$(dir)/rules.cpp: $(dir)/rules.pr
@echo "RULEGEN $@"
$(dir)/rulegen < $< > $@
generator_run:
cat rules.pr | ./parser
$(RULEGEN): $(rulegen_objs)
@echo "HOSTLD $@"
$(HOSTCXX) $(rulegen_objs) -o $@