summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 13 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index fb38610..a63ae06 100644
--- a/Makefile
+++ b/Makefile
@@ -10,10 +10,14 @@ WARNINGS := -Wall -Wextra -Wpedantic -Wformat=2 -Wstrict-aliasing=3 -Wstrict-ove
override CFLAGS ?= -g
override CFLAGS += -std=c11 $(WARNINGS)
override CPPFLAGS += -Isrc
+override COLMFLAGS += -Isrc/compiler
-bins = fspec-dump dec2bin xidec xi2path xils xifile uneaf
+bins = fspec-info dec2bin xidec xi2path xils xifile uneaf
all: $(bins)
+%.c: %.lm
+ colm $(COLMFLAGS) -c $^
+
%.c: %.rl
ragel $^
@@ -23,20 +27,17 @@ all: $(bins)
$(bins): %:
$(LINK.c) $(filter %.c %.a,$^) $(LDLIBS) -o $@
-fspec-membuf.a: src/util/membuf.h src/util/membuf.c
-fspec-ragel.a: src/util/ragel/ragel.h src/util/ragel/ragel.c
-fspec-lexer-stack.a: src/fspec/ragel/lexer-stack.h src/fspec/ragel/lexer-stack.c
-fspec-lexer-expr.a: src/fspec/ragel/lexer-expr.h src/fspec/ragel/lexer-expr.c
-fspec-bcode.a: src/fspec/memory.h src/fspec/private/bcode-types.h src/fspec/bcode.h src/fspec/bcode.c fspec-ragel.a
-fspec-lexer.a: src/fspec/lexer.h src/fspec/ragel/lexer.c fspec-lexer-stack.a fspec-lexer-expr.a fspec-bcode.a
-fspec-validator.a: src/fspec/validator.h src/fspec/ragel/validator.c fspec-ragel.a
+fspec-compiler-native.a: private CFLAGS = -Wno-unusued-parameter
+fspec-compiler-native.a: src/compiler/native.c
+fspec-compiler.a: private CFLAGS = -std=c11
+fspec-compiler.a: src/compiler/compiler.c fspec-compiler-native.a
-fspec-dump: private CPPFLAGS += $(shell pkg-config --cflags-only-I squash-0.8)
-fspec-dump: private LDLIBS += $(shell pkg-config --libs-only-l squash-0.8)
-fspec-dump: src/bin/fspec/dump.c fspec-ragel.a fspec-membuf.a fspec-bcode.a fspec-lexer-stack.a fspec-lexer-expr.a fspec-lexer.a fspec-validator.a
+fspec-info: private LDLIBS += -lcolm
+fspec-info: src/bin/fspec-info.c fspec-compiler.a fspec-compiler-native.a
dec2bin: src/bin/misc/dec2bin.c
+xidec: private CFLAGS += -Wno-strict-overflow
xidec: src/bin/xi/xidec.c
xi2path: src/bin/xi/xi2path.c
xils: src/bin/xi/xils.c
@@ -51,7 +52,7 @@ install-bin: $(bins)
install: install-bin
clean:
- $(RM) src/util/ragel/*.c src/fspec/ragel/*.c
+ $(RM) src/compiler/compiler.c
$(RM) $(bins) *.a
.PHONY: all clean install