Blame view

fz/Makefile 1.32 KB
aa862a87   Salvador Abreu   removed unused fz...
1
2
3
4
SRC =	        
OBJ = 		flatzinc.tab.o
GENCFILES = 	flatzinc.tab.c lex.yy.c 
OTHER = 	flatzinc.output 
e9654c4b   Salvador Abreu   added flatzinc pa...
5

2ae2c2a3   Salvador Abreu   allow for multipl...
6
7
8
PLFILES =       $(filter-out out-%.pl,$(wildcard *.pl))
PLOFILES =   	$(patsubst %.pl,%.o,$(PLFILES))

e88c58ae   Salvador Abreu   new back-end-spec...
9
10
11
# XXX/output.pl produces fz-XXX, the flatzinc-to-XXX compiler
FZBACKS =       $(patsubst %/output.pl,%,$(wildcard */output.pl))
FZSEM =  	$(patsubst %/output.pl,fz-%,$(wildcard */output.pl))
1fa8bcd2   Salvador Abreu   back-end specific...
12
13
14
FZPLFILES =     $(foreach B,$(FZBACKS),$(wildcard $B/*.pl))
FZOFILES =      $(patsubst %.pl,%.o,$(FZPLFILES))
FZAFILES =      $(patsubst %,lib%.a,$(FZBACKS))
e9654c4b   Salvador Abreu   added flatzinc pa...
15

aa862a87   Salvador Abreu   removed unused fz...
16
17
18
19
20
21
# NOTE: we need to pass the `-l' flag to ensure the scanner internal
# variable `yylineno' is available.
#
LEX =		flex
LEXFLAGS =      -l
LEXLIB =	
e9654c4b   Salvador Abreu   added flatzinc pa...
22

aa862a87   Salvador Abreu   removed unused fz...
23
24
YACC =		bison
YACCFLAGS =	-v
e9654c4b   Salvador Abreu   added flatzinc pa...
25

aa862a87   Salvador Abreu   removed unused fz...
26
27
CC =		gcc	
CFLAGS =	-g -O
e9654c4b   Salvador Abreu   added flatzinc pa...
28

aa862a87   Salvador Abreu   removed unused fz...
29
GPLC =		gplc
e9654c4b   Salvador Abreu   added flatzinc pa...
30

aa862a87   Salvador Abreu   removed unused fz...
31
32
33
34
35
RM =		/bin/rm -f

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

1fa8bcd2   Salvador Abreu   back-end specific...
36
all: fzp $(FZSEM) $(PLOFILES) $(FZOFILES) $(FZAFILES)
aa862a87   Salvador Abreu   removed unused fz...
37
38
39
40

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

1fa8bcd2   Salvador Abreu   back-end specific...
41
fz-%:	$(PLOFILES) lib%.a
2ae2c2a3   Salvador Abreu   allow for multipl...
42
43
	$(GPLC) -o $@ $+

1fa8bcd2   Salvador Abreu   back-end specific...
44
45
46
lib%.a: $(FZOFILES)
	ar rv $@ $+

2ae2c2a3   Salvador Abreu   allow for multipl...
47
48
%.o: %.pl
	$(GPLC) $(GPLCFLAGS) -c $<
aa862a87   Salvador Abreu   removed unused fz...
49
50

flatzinc.tab.c:	flatzinc.y lex.yy.c
1fa8bcd2   Salvador Abreu   back-end specific...
51
	$(YACC) $(YACCFLAGS) flatzinc.y
aa862a87   Salvador Abreu   removed unused fz...
52
53

lex.yy.c:	flatzinc.l
1fa8bcd2   Salvador Abreu   back-end specific...
54
	$(LEX) $(LEXFLAGS) flatzinc.l
e9654c4b   Salvador Abreu   added flatzinc pa...
55

e9654c4b   Salvador Abreu   added flatzinc pa...
56
clean:
1fa8bcd2   Salvador Abreu   back-end specific...
57
58
59
60
	$(RM)					\
	  $(OBJ) $(PLOFILES)			\
	  $(FZOFILES) $(FZAFILES)		\
	  $(GENCFILES) $(OTHER) core
aa862a87   Salvador Abreu   removed unused fz...
61
62

clobber:	clean
1fa8bcd2   Salvador Abreu   back-end specific...
63
	$(RM) $(EXE_FILE)
e9654c4b   Salvador Abreu   added flatzinc pa...
64

aa862a87   Salvador Abreu   removed unused fz...
65
66
.PHONY: distclean
distclean: clobber