# Variables & options for compiler
CC = gcc
CFLAGS = -g -Wall
# Variables & options for linker
LD = gcc
LDFLAG =
# Location of rm
RM = /bin/rm -f
# Objects and librairies
OBJS = main.o score.o store.o cut.o
LIBS = /usr/lib/libmpfr.a -lgmp -ldb -lm
#LIBS = /usr/local/lib/libmpfr.a -lgmp -ldb -lm
# name og the programme
PROG = tokenize
# About Flex
LEXL = tokenize.l
LEXC = lex.yy.c
FLEX = flex -i
LEXLIB = -lfl

all: $(PROG)

# Creating programme
$(PROG): $(OBJS) $(LEXL)
	$(FLEX) $(LEXL)
	$(LD) -o $(PROG) $(OBJS) $(LIBS) $(LEXC) $(LEXLIB) 

# Compiling all the .o
%.o: %.c
	$(CC) $(CFLAGS) -c $<

# Cleaning
clean:
	rm -f $(PROG) $(OBJS) $(LEXC)

