]> vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

git git / sw / tic2json.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f62bb43)
Makefile: prepare to support multiple versions
2021年8月21日 11:55:16 +0000 (13:55 +0200)
2021年8月21日 14:20:24 +0000 (16:20 +0200)

diff --git a/Makefile b/Makefile
index 634301d57526a86da7516e44332046c2041788c4..4b21b71290cf83bf7b1be0e56341103cfc1db657 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,15 @@
-all: tic2json
+MAIN := tic2json
+CFLAGS := -Wall -Os
+TICVERSIONS := 01 02
+
+# don't touch below this line
+
+TICS := $(addprefix ticv,$(TICVERSIONS))
+TICSDEFS := $(addprefix -DTICV,$(TICVERSIONS))
+
+CFLAGS += $(TICSDEFS) -DBINNAME='"$(MAIN)"'
+
+all: $(MAIN)
%.lex.c: %.l %.tab.h
# The ideal size for the flex buffer is the length of the longest token expected, in bytes, plus a little more.
@@ -7,13 +18,9 @@ all: tic2json
%.tab.h %.tab.c: %.y
bison -Wno-other -p $*yy -d $<
-tic2json: %: ticv02.tab.c ticv02.lex.c %.c
- $(CC) -DBINNAME='"$@"' -Os -Wall $^ -o $@
+tic2json.o: $(addsuffix .tab.h,$(TICS))
-clean:
- $(RM) tic2json *.output *.tab.h *.tab.c *.lex.c
-
-# disable implicit rules we don't want
-%.c: %.y
-%.c: %.l
+$(MAIN): $(addsuffix .tab.o,$(TICS)) $(addsuffix .lex.o,$(TICS)) tic2json.o
+clean:
+ $(RM) $(MAIN) *.output *.tab.h *.tab.c *.lex.c *.o
tic2json TIC parser/converter
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /