Makefile 767 Bytes
SRC =	        
OBJ = 		flatzinc.tab.o
GENCFILES = 	flatzinc.tab.c lex.yy.c 
OTHER = 	flatzinc.output 

PLFILES =       $(wildcard *.pl)

# NOTE: we need to pass the `-l' flag to ensure the scanner internal
# variable `yylineno' is available.
#
LEX =		flex
LEXFLAGS =      -l
LEXLIB =	

YACC =		bison
YACCFLAGS =	-v

CC =		gcc	
CFLAGS =	-g -O

GPLC =		gplc

RM =		/bin/rm -f

%.ast:: %.fzn
	fzp < $< > $@

all: fzp fzsem

fzp:	$(OBJ)
	$(CC) $(CFLAGS) -o $@ $(OBJ) $(LEXLIB)

fzsem: $(PLFILES)
	$(GPLC) -o $@ $(PLFILES)

flatzinc.tab.c:	flatzinc.y lex.yy.c
		$(YACC) $(YACCFLAGS) flatzinc.y

lex.yy.c:	flatzinc.l
		$(LEX) $(LEXFLAGS) flatzinc.l

clean:
		$(RM) $(OBJ) $(GENCFILES) $(OTHER) core

clobber:	clean
		$(RM) $(EXE_FILE)

.PHONY: distclean
distclean: clobber