##FLAGS= -m32 -O6 -g -Wall -shared
#FLAGS=  -g -Wall -fPIC
#OBJS = utils.o#
#
#all : utils
#
#.cpp.o :
#	$(CC) $(FLAGS) $<
#        
#utils : $(OBJS)
#	$(CC) -o $@ $(OBJS)
#        
#clean:
#	rm -f $(OBJS)

CC=g++
CFLAGS=-c -Wall
LDFLAGS=
SOURCES=$(wildcard *.cpp) $(wildcard Action/*.cpp) $(wildcard Exception/*.cpp) $(wildcard World/*.cpp) \
				$(wildcard Exp/*.cpp) $(wildcard Exp/Comparison/*.cpp) $(wildcard Exp/Effect/*.cpp) \
				$(wildcard Exp/Effect/Assign/*.cpp) $(wildcard Exp/Formula/*.cpp) $(wildcard Exp/Formula/Defined/*.cpp) \
				$(wildcard Exp/Formula/Defined/TLPlan/*.cpp) $(wildcard Exp/Formula/Described/*.cpp) \
				$(wildcard Exp/Logical/*.cpp) $(wildcard Exp/Logical/TLPlan/*.cpp) $(wildcard Exp/Metric/*.cpp) \
				$(wildcard Exp/Numeric/*.cpp) $(wildcard Exp/Numeric/TLPlan/*.cpp) $(wildcard Exp/Temporal/*.cpp) \
				$(wildcard Exp/Temporal/Composite/*.cpp) $(wildcard Exp/Temporal/Composite/TLPlan/*.cpp) \
				$(wildcard Exp/Temporal/*.cpp) $(wildcard Exp/Temporal/TLPlan/*.cpp) $(wildcard Exp/Term/*.cpp) \
				$(wildcard Exp/Term/Type/*.cpp)
OBJECTS=$(SOURCES:.cpp=.o)
DEPENDENCIES=../Utils/utils.a
LIBRARY=pddlparser.a

all: $(SOURCES) $(LIBRARY)

$(LIBRARY): $(OBJECTS)
	ar cru $(LIBRARY) $(OBJECTS) $(DEPENDENCIES)
	ranlib $(LIBRARY)

.cpp.o:
	$(CC) $(CFLAGS) $< -o $@

clean:
	rm -f $(OBJECTS) $(LIBRARY)
