CC     = g++
CFLAGS = -ggdb -Wall -O2

BINDIR = $(HOME)/olivex/bin

PROG = LG2grf
PROG2 = metagrf
CORE = compile.o llist.o ustring.o tree.o utilities.o \
       tab_i.o tab_u.o tab2_i.o lexicon.o tree2.o lexicon2.o llist_i.o table.o 
CORE2 = compile_meta.o llist.o ustring.o tree.o utilities.o \
	tab_i.o tab_u.o tab2_i.o lexicon.o tree2.o lexicon2.o llist_i.o table.o

all: $(PROG) $(PROG2)
	@echo all is done.


$(PROG): $(CORE)
	$(CC) $(CFLAGS) $(CORE) -o $(PROG)

$(PROG2): $(CORE2)
	$(CC) $(CFLAGS) $(CORE2) -o $(PROG2)

install: $(PROG) $(PROG2)
	cp $(PROG) $(BINDIR)
	cp $(PROG2) $(BINDIR)

clean:
	rm -f $(CORE) $(PROG) $(PROG2) *~

exemple1:
	./compile V_3.txt V_3_config.conf ONE test_grf/reference.grf test_grf/T3.grf test_grf/T3 NULL

exemple2:
	./compile V_3.txt V_3_config.conf ONE test_grf/reference.grf test_grf/T3.grf test_grf/T3 "<ENT>"

exemple3:
	./compile V_3b.txt NULL TWO test_grf/reference.grf test_grf/T3.grf test_grf/T3 NULL
