ifneq ($(SRCS), $(BLANK)) error: echo "Please use an updated makefile."; echo "This can be found at $$ISISROOT/make/Makefile.apps"; endif INCS := $(wildcard *.h) # Figure out Qt Q_OBJECTS # QT - get all header files with 'Q_OBJECT' Output: '%.h: QOBJECT' ifneq ($(INCS), $(BLANK)) QOBJ := $(shell grep -HI -m1 '^ *Q_OBJECT *$$' $(INCS)) # filter out 'Q_OBJECT' from '%.h: QOBJECT' QCOLN := $(filter-out Q_OBJECT, $(QOBJ)) # filter out ':' from '%.h:' QINC := $(subst :, , $(QCOLN)) endif # Get CPPs that dont include intermediate files or the unit test (if object) CPPS := $(wildcard *.cpp *.cc) # List of all compilable extensions! CPPS := $(filter-out moc_%.cpp, $(CPPS)) CPPS := $(filter-out unitTest.cpp, $(CPPS)) # Handle Qt resource files (qrc) QRCS := $(wildcard *.qrc) QTRESOURCEFILES := $(QRCS:%.qrc=qrc_%.cpp) # Protocol buffer files PROTOS := $(wildcard *.proto) # Sort removes duplicates... make sure we have proto headers INCS := $(sort $(INCS) $(PROTOS:%.proto=%.pb.h)) # Sources include Qt moc files and qrc files SRCS := $(QTRESOURCEFILES) $(QINC:%.h=moc_%.cpp) $(PROTOS:%.proto=%.pb.cc) $(CPPS) SRCS := $(sort $(SRCS)) # Ui Files UIFILES := $(wildcard *.ui) UIHEADERS := $(UIFILES:%.ui=ui_%.h) # Every cpp/cc/c generates an object (.o) OBJS := $(SRCS:%.cpp=%.o) OBJS := $(OBJS:%.cc=%.o) OBJS := $(OBJS:%.c=%.o) BINS := $(shell basename `pwd`) include $(ISISROOT)/make/isismake.macros MOCINC = $(wildcard *.h) MOCGEN = $(wildcard moc_*.cpp) PROTOS = $(wildcard *.proto) PROTOSGEN = $(wildcard *.pb.*) PROTOSOBJ = $(wildcard *.pb.o) #TODO: This is obsolete. We need to not require these any more. # These cause targets such as .cpp.o to work properly. .SUFFIXES: .SUFFIXES: .cpp .o .SUFFIXES: .c .o .SUFFIXES: .xml .html .SUFFIXES: .proto .pb.h .pb.cc .SUFFIXES: .cc .o app: $(MAKE) $(BINS) $(BINS): $(UIHEADERS) $(QTRESOURCEFILES) protos $(OBJS) $(CXX) $(ALLLIBDIRS) $(ISISLDFLAGS) $(ISISLDRPATH) -o $@ $(OBJS) $(ALLLIBS) .cpp.o: qtmoc $(CXX) $(ALLINCDIRS) $(ISISCPPFLAGS) $(CPPFLAGS) -c -o $@ $? .c.o : $(CC) $(ALLINCDIRS) $(ISISCFLAGS) $(CFLAGS) -c -o $@ $? .cc.o: $(CXX) $(ALLINCDIRS) $(ISISCPPFLAGS) -c -o $@ $? .xml.html : $(XALAN) $(XALAN_VALIDATE_OPTION) $(XALAN_OUTFILE_OPTION) $@ $(XALAN_INFILE_OPTION) $? $(XALAN_XSL_OPTION) $(ISISROOT)/src/docsys/Application/presentation/ProgTester/IsisApplicationDocStyle.xsl protos: $(PROTOS:%.proto=%.pb.h) $(PROTOS:%.proto=%.pb.cc) %.pb.cc %.pb.h: %.proto protoc -I$( /dev/null; \ if [ -f "DarwinErrors.lis" ]; then \ cat DarwinErrors.lis; \ fi; \ $(RM) DarwinErrors.lis; \ fi validxml: $(XALAN) $(XALAN_VALIDATE_OPTION) $(XALAN_OUTFILE_OPTION) /dev/null $(XALAN_INFILE_OPTION) $(BINS).xml $(XALAN_XSL_OPTION) $(ISISROOT)/src/docsys/Application/presentation/ProgTester/IsisApplicationDocStyle.xsl; docs: mkdir -p $(ISISROOT)/src/docsys/Application/data/`basename $(CURDIR)` cp -p `basename $(CURDIR)`.xml $(ISISROOT)/src/docsys/Application/data/`basename $(CURDIR)` if [ -d assets ]; \ then \ cp -pr assets $(ISISROOT)/src/docsys/Application/data/`basename $(CURDIR)`; \ fi chmod -R +w $(ISISROOT)/src/docsys/Application/data/`basename $(CURDIR)` test: if [ ! -d "tsts" ]; \ then \ echo ""; \ printf %-6s ""; \ echo "no tsts folder"; \ elif [ -f "tsts/Makefile" ]; \ then \ cd tsts; $(MAKE) test; \ else \ echo ""; \ printf %-6s ""; \ echo "no makefile"; \ fi testdir: if [ ! -d "tsts" ]; \ then \ $(MKDIR) tsts; \ $(CP) $(ISISROOT)/make/Makefile.appstststree tsts/Makefile; \ else \ echo ""; \ printf %-6s ""; \ echo "tsts folder already exists"; \ fi html: $(MAKE) `basename $(CURDIR)`.html; help: echo "Isis Make Application Commands" echo "------------------------ " echo "make : Builds the Application" echo "make MODE=DEBUG[,CWD,MEMCHECK] : Builds the Application for stack tracing and " echo " memory debugging" echo "make install : Calls the make target and copies the application" echo " to $ISISROOT/bin/" echo "make html : Builds the html page for the Application" echo "make docs : Copies the .xml and assets folder to docsys area" echo " for full documentation building" echo "make clean : Removes the application, *.html and *.o files." echo " Also cleans the test directories" echo "make sanitize : Calls the clean target then removes tttt* junk.*" echo " and TEMP* files" echo "make testdir : Make the test directory for new applications" echo "make test : Run all app tests and print result, remove" echo " output" echo "make test MODE=NOCLEAN : Run test and print result, leave output"