diff --git a/fz/Makefile b/fz/Makefile index 5a69d99..d45a63a 100644 --- a/fz/Makefile +++ b/fz/Makefile @@ -3,7 +3,11 @@ OBJ = flatzinc.tab.o GENCFILES = flatzinc.tab.c lex.yy.c OTHER = flatzinc.output -PLFILES = $(wildcard *.pl) +PLFILES = $(filter-out out-%.pl,$(wildcard *.pl)) +PLOFILES = $(patsubst %.pl,%.o,$(PLFILES)) + +# out-XXX.pl produces fz-XXX, the flatzinc-to-XXX compiler +FZSEM = $(patsubst out-%.pl,fz-%,$(wildcard out-*.pl)) # NOTE: we need to pass the `-l' flag to ensure the scanner internal # variable `yylineno' is available. @@ -25,13 +29,16 @@ RM = /bin/rm -f %.ast:: %.fzn fzp < $< > $@ -all: fzp fzsem +all: fzp $(FZSEM) $(PLOFILES) $(patsubst %.pl,%.o,$(wildcard out-*.pl)) fzp: $(OBJ) $(CC) $(CFLAGS) -o $@ $(OBJ) $(LEXLIB) -fzsem: $(PLFILES) - $(GPLC) -o $@ $(PLFILES) +fz-%: out-%.o $(PLOFILES) + $(GPLC) -o $@ $+ + +%.o: %.pl + $(GPLC) $(GPLCFLAGS) -c $< flatzinc.tab.c: flatzinc.y lex.yy.c $(YACC) $(YACCFLAGS) flatzinc.y -- libgit2 0.21.2