# Source directories
SRCDIR = src/api/servlet
OUTDIR = src/test/reflection

# Environment variables
CC = genreflex
CFLAGS = -o $(OUTDIR) -DQT_CORE_LIB
IFLAGS = -I/usr/local/reflex/include  \
	-I/usr/local/poco/include \
	-I/usr/local/leveldb/include \
	-I/usr/local/Qt4.8/mkspecs/unsupported/macx-clang \
	-I/Library/Frameworks/QtCore.framework/Headers \
	-Isrc/api -Isrc/test

# All source files
FILES = $(SRCDIR)/Servlet.h \
	$(SRCDIR)/DocRootServlet.h

# All object files to be produced
OFILES = $(OUTDIR)/Servlet_rflx.cpp \
	$(OUTDIR)/DocRootServlet_rflx.cpp

# Suffix rule for converting .h files to .cpp files
$(OUTDIR)/%.cpp:
	$(CC) $< $(CFLAGS) $(IFLAGS)

# Make and link all files
all: $(OFILES) 
	@echo "Reflection files successfully generated."
	@echo "You can build the rest of your application using these generated files under $(OUTDIR)."

# Remove all the object files that make the library
clean:
	@echo "Removing all object files"
	$(RM) $(OFILES)

# Dependencies for sources and header files
$(OUTDIR)/Servlet_rflx.cpp: $(SRCDIR)/Servlet.h
$(OUTDIR)/DocRootServlet_rflx.cpp: $(SRCDIR)/DocRootServlet.h
