sources=$(wildcard *.cc *.h *.d Makefile Makefile.common)

#massima ottimizzazione:
#CPPFLAGS=-O3 -DNDEBUG -DINLINE

first: all

include Makefile.common

all: algebra.o parser.o libexpr.a

algebra-write.o: algebra.cc
	g++ -c -DWRITE_RULES $< -o $@

lib: libexpr.a

libexpr.a: algebra.o parser.o
	rm -f $@
	ar -r $@ $^

calc: calc.o algebra.o parser.o 
	g++ $(CPPFLAGS) -lm $^ -o $@

test: test.o algebra.o parser.o 
	g++ $(CPPFLAGS) -lm $^ -o $@

calc-write: calc.o algebra-write.o parser.o
	g++ $(CPPFLAGS) -lm $^ -o $@

clear.user:
	rm -fr test calc libexpr.a


