Revert "Merge pull request #533 from nasa/MakefileCleanup"

This reverts commit 269ed77cb4, reversing
changes made to d97f482219.
This commit is contained in:
Alex Lin 2018-03-02 08:59:26 -06:00
parent c9a121aa27
commit 4bf35a9c82
16 changed files with 66 additions and 81 deletions

View File

@ -134,22 +134,13 @@ endif
# libraries.
ICG_EXE := ${TRICK_HOME}/bin/trick-ICG
################################################################################
# Formating Variables
################################################################################
# Appends a newline to the -w / --print-directories leaving message for make.
# This helps break up directory traversal into blocks.
MAKE_TRAVERSAL_NEWLINE := | sed '/^make.*: Leaving directory/a\ '
################################################################################
# RULES
################################################################################
# DEFAULT TARGET
# 1 Build Trick-core and Trick Data-products.
all: no_dp dp
@ echo -e "\e[32mTrick has been successfully compiled.\e[34m"
@date
@ echo ; echo "Trick compilation complete:" ; date
ifeq ($(USE_JAVA), 1)
all: java
@ -158,11 +149,10 @@ endif
#-------------------------------------------------------------------------------
# 1.1 Build Trick-core
no_dp: $(TRICK_LIB) $(TRICK_SWIG_LIB)
@ echo -e "\e[32mTrick libraries compiled:\e[34m" ; date ; echo -e "\e[0m"
@ echo ; echo "Trick libs compiled:" ; date
# 1.1.1 Build libTrick.a
$(TRICK_LIB): $(SIM_SERV_DIRS) $(UTILS_DIRS) | $(TRICK_LIB_DIR)
@ echo -e "\e[34m[---Building $@---]\e[0m"
ar crs $@ $(SIM_SERV_OBJS) $(UTILS_OBJS)
ifeq ($(USE_ER7_UTILS), 1)
@ -170,27 +160,23 @@ ER7_UTILS_LIB = $(TRICK_LIB_DIR)/liber7_utils.a
no_dp: $(ER7_UTILS_LIB)
$(ER7_UTILS_LIB): $(ER7_UTILS_DIRS) | $(TRICK_LIB_DIR)
@ echo -e "\e[34m[---Building $@---]\e[0m"
ar crs $@ $(ER7_UTILS_OBJS)
endif
# 1.1.1.1 Compile the objects in the specified sim_services directories.
.PHONY: $(SIM_SERV_DIRS)
$(SIM_SERV_DIRS): icg_sim_serv $(TRICK_LIB_DIR)
@ echo -e "\e[34m[---Building $@---]\e[0m"
@ $(MAKE) -C $@ trick
# 1.1.1.2 Compile the objects in the specified utils directories.
.PHONY: $(UTILS_DIRS)
$(UTILS_DIRS): icg_sim_serv
@ echo -e "\e[34m[---Building $@---]\e[0m"
@ $(MAKE) -C $@ trick
# 1.1.1.3 Compile the objects in the specified er7_utils directories.
.PHONY: $(ER7_UTILS_DIRS)
$(ER7_UTILS_DIRS): TRICK_CXXFLAGS += -Wno-unused-parameter
$(ER7_UTILS_DIRS): make_er7_makefiles icg_sim_serv
@ echo -e "\e[34m[---Building $@---]\e[0m"
@ $(MAKE) -C $@ trick
.PHONY: make_er7_makefiles
@ -207,12 +193,10 @@ endif
# header files.
.PHONY: icg_sim_serv
icg_sim_serv: $(ICG_EXE)
@ echo -e "\e[34m[---Generating Interface Code---]\e[0m"
${TRICK_HOME}/bin/trick-ICG -s -m ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh
# 1.1.1.4.1 Build the Interface Code Generator (ICG) executable.
$(ICG_EXE) :
@ echo -e "\e[34m[---Building Interface Code Generator---]\e[0m"
$(MAKE) -C trick_source/codegen/Interface_Code_Gen
# 1.1.1.5 Create Trick Library directory.
@ -221,25 +205,21 @@ $(TRICK_LIB_DIR):
# 1.1.2 Build libTrick_pyip.a (Swig Lib)
$(TRICK_SWIG_LIB): $(SWIG_DIRS) | $(TRICK_LIB_DIR)
@ echo -e "\e[34m[---Building $@---]\e[0m"
ar crs $@ $(SWIG_OBJS)
.PHONY: $(SWIG_DIRS)
$(SWIG_DIRS): icg_sim_serv $(TRICK_LIB_DIR)
@ echo -e "\e[34m[---Building $@---]\e[0m"
@ $(MAKE) -C $@ trick
#-------------------------------------------------------------------------------
# 1.2 Build Trick's Data-products Applications.
.PHONY: dp
dp: ${TRICK_HOME}/trick_source/trick_utils/units
@ echo -e "\e[34m[---Building Data-Products Applications---]\e[0m"
@ $(MAKE) -C ${TRICK_HOME}/trick_source/data_products
#-------------------------------------------------------------------------------
# 1.3 Build Trick's Java Tools
java:
@ echo -e "\e[34m[---Building Java Tools---]\e[0m"
@ $(MAKE) -C ${TRICK_HOME}/trick_source/java
.PHONY: javadoc
@ -270,9 +250,7 @@ premade:
################################################################################
# This target runs Trick's Unit-tests and simulation-tests.
test: unit_test sim_test
@ echo -e "\n\e[32m#####################################"
@ echo -e "\e[32mAll unit tests completed sucessfully.\e[0m"
@ echo -e "\e[32m#####################################\n"
@ echo "All tests completed sucessfully"
.PHONY: $(UNIT_TEST_DIRS)
$(UNIT_TEST_DIRS):
@ -291,45 +269,43 @@ sim_test:
# CLEAN Targets
################################################################################
clean: clean_sim_serv clean_utils clean_swig clean_dp clean_ICG clean_java
@/bin/rm -rf $(TRICK_BIN_DIR)
@/bin/rm -rf $(TRICK_LIB_DIR)
@echo -e "\e[32mTrick has been successfully cleaned."
ifeq ($(USE_ER7_UTILS), 1)
clean: clean_er7_utils
endif
clean_sim_serv:
@for i in $(SIM_SERV_DIRS) ; do \
$(MAKE) -C $$i real_clean $(MAKE_TRAVERSAL_NEWLINE); \
$(MAKE) -C $$i real_clean ; \
done
@ $(MAKE) -C ${TRICK_HOME}/trick_source/sim_services/mains real_clean $(MAKE_TRAVERSAL_NEWLINE)
@ $(MAKE) -C ${TRICK_HOME}/trick_source/sim_services/mains real_clean
clean_er7_utils: make_er7_makefiles
@for i in $(ER7_UTILS_DIRS) ; do \
$(MAKE) -C $$i real_clean $ $(MAKE_TRAVERSAL_NEWLINE); \
$(MAKE) -C $$i real_clean ; \
rm $$i/Makefile; \
done
clean_utils:
@for i in $(UTILS_DIRS) ; do \
$(MAKE) -C $$i real_clean $(MAKE_TRAVERSAL_NEWLINE); \
$(MAKE) -C $$i real_clean ; \
done
clean_swig:
@for i in $(SWIG_DIRS) ; do \
$(MAKE) -C $$i real_clean $(MAKE_TRAVERSAL_NEWLINE); \
$(MAKE) -C $$i real_clean ; \
done
ifeq ($(USE_ER7_UTILS), 1)
clean_swig: make_er7_makefiles
clean_swig: make_er7_makefiles
endif
clean_ICG :
@ $(MAKE) -C ${TRICK_HOME}/trick_source/codegen/Interface_Code_Gen clean $(MAKE_TRAVERSAL_NEWLINE)
$(MAKE) -C ${TRICK_HOME}/trick_source/codegen/Interface_Code_Gen clean
clean_unit_test:
@/bin/rm -rf ${TRICK_HOME}/trick_test/*.xml
@ -338,13 +314,14 @@ clean_unit_test:
done
clean_doxygen:
@ $(MAKE) -C ${TRICK_HOME}/doxygen clean $(MAKE_TRAVERSAL_NEWLINE)
@ $(MAKE) -C ${TRICK_HOME}/doxygen clean
clean_dp:
@ $(MAKE) clean -C ${TRICK_HOME}/trick_source/data_products $(MAKE_TRAVERSAL_NEWLINE)
@ $(MAKE) clean -C ${TRICK_HOME}/trick_source/data_products
clean_java:
@ $(MAKE) -C ${TRICK_HOME}/trick_source/java clean $(MAKE_TRAVERSAL_NEWLINE)
@ $(MAKE) -C ${TRICK_HOME}/trick_source/java clean
# FIXME: Seems to me that the for loop below should be removed and that the

View File

@ -160,7 +160,10 @@ $(L_OBJS) : $(OBJ_DIR)/%.lex.o : $(SRC_DIR)%.lex.c $(SRC_DIR)%.tab.h | $(OBJ_DI
$(Y_OBJS) : $(OBJ_DIR)/%.tab.o : $(SRC_DIR)%.tab.c | $(OBJ_DIR)
$(CD_CMD) $(TRICK_CPPC) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -c ${<F} -o $(UP_DIR)$@
#
# OTHER RULES
#
depend:
@ $(TRICK_CPPC) -MM $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) $(C_SRC) $(CPP_SRC) >> $(DEPTEMPFILE)
@ -171,15 +174,15 @@ depend:
io_clean:
$(RM) -rf io_src
clean:
$(RM) -rf $(OBJ_DIR) $(L_C) $(Y_C) $(Y_H)
real_clean: clean io_clean
$(RM) -rf xml *~ *.bak core
@ echo "Directory is really clean!"
clean:
$(RM) -rf $(OBJ_DIR) $(L_C) $(Y_C) $(Y_H)
help :
@ echo -e "\n\
Source Directory Make Options:\n\
make - Compiles are source files\n\
\n\
@ -191,3 +194,4 @@ Source Directory Make Options:\n\
\n\
make real_clean - Deletes xml/, io_src/,\n\
and object_${TRICK_HOST_CPU}/ directories\n"

View File

@ -55,6 +55,7 @@ OBJECT_FILES = $(C_OBJECT_FILES) $(CXX_OBJECT_FILES)
all: ${TRICK_HOME}/bin/trick-gxplot
${TRICK_HOME}/bin/trick-gxplot: ${LIBDIR}/libDPM.a ${LIBDIR}/libDPC.a ${LIBDIR}/libDPV.a $(OBJECT_FILES)
@echo "===== Making gxplot ====="
${CPP} ${CFLAGS} ${INCDIRS} -o $@ $(OBJECT_FILES) $(ALL_LIBS) ${XLIBS} ${LIBRTDEF} ${CONTROLLER_LIBS} -lDPV
$(C_OBJECT_FILES) : $(OBJDIR)/%.o : %.c

View File

@ -10,15 +10,15 @@ apps: fxplot
endif
fxplot:
@$(MAKE) -C FXPLOT
$(MAKE) -C FXPLOT
gxflot:
@$(MAKE) -C GXPLOT
$(MAKE) -C GXPLOT
clean:
@$(MAKE) -C FXPLOT clean
@$(MAKE) -C GXPLOT clean
$(MAKE) -C FXPLOT clean
$(MAKE) -C GXPLOT clean
spotless: clean
@$(MAKE) -C FXPLOT spotless
@$(MAKE) -C GXPLOT spotless
$(MAKE) -C FXPLOT spotless
$(MAKE) -C GXPLOT spotless

View File

@ -57,3 +57,4 @@ clean:
spotless: clean
${RM} ${LIBDIR}/${LIBNAME}

View File

@ -142,6 +142,7 @@ depend:
@ echo "Appended dependencies to $(MAKEFILE)"
clean:
@echo "===== Cleaning DPC_TEST Directory ====="
${RM} *~
${RM} *.o

View File

@ -131,6 +131,7 @@ clean:
spotless: clean
${RM} tcdstest
# Dependencies
#######################################################################

View File

@ -131,6 +131,7 @@ clean:
spotless: clean
${RM} udstest
# Dependencies
#######################################################################

View File

@ -25,9 +25,9 @@ clean:
$(MAKE) -C UDS clean
spotless:
@ $(MAKE) -C DPC_TEST spotless
@ $(MAKE) -C DPM_TEST spotless
@ $(MAKE) -C DS_exercisor spotless
@ $(MAKE) -C DS spotless
@ $(MAKE) -C TCDS spotless
@ $(MAKE) -C UDS spotless
$(MAKE) -C DPC_TEST spotless
$(MAKE) -C DPM_TEST spotless
$(MAKE) -C DS_exercisor spotless
$(MAKE) -C DS spotless
$(MAKE) -C TCDS spotless
$(MAKE) -C UDS spotless

View File

@ -23,23 +23,21 @@ all: $(LIBDIRS) $(APPDIRS)
always_make:
docs: always_make
@ echo -e "\e[34m[---Making Documentation---]\e[0m"
@echo "===== Making DOCS ====="
doxygen DPX.doxygen
testing: $(LIBDIRS)
@ echo -e "\e[34m[---Building TESTING---]\e[0m"
@echo "===== Making TESTING ====="
$(MAKE) -C TESTING
@ echo ""
$(LIBDIRS):
@ echo -e "\e[34m[---Building $@---]\e[0m"
@ echo ; echo "==: Compile $@"
@ $(MAKE) -C $@
@ echo ""
$(APPDIRS): $(LIBDIRS)
@ echo -e "\e[34m[---Building $@---]\e[0m"
@echo "===== Making APPS ====="
@ echo ; echo "==: Compile $@"
@ $(MAKE) -C $@
@ echo ""
clean:
@ for i in $(LIBDIRS) ; do \
@ -48,12 +46,11 @@ clean:
@ for i in $(APPDIRS) ; do \
$(MAKE) -C $$i clean ; \
done
@ $(MAKE) -C TESTING spotless
@ $(MAKE) -C APPS spotless
${RM} DOCS
${RM} -rf DOCS
${RM} ${LIBDIR}
$(MAKE) -C TESTING spotless
$(MAKE) -C APPS spotless
$(MAKE) -C XML clean
${RM} *~
${RM} *.o

View File

@ -94,7 +94,7 @@ depend:
clean:
rm -rf $(OBJ_DIR)
rm -f $(LIBDIR)/$(LIBNAME)
rm -f $(LIBDIR)/$(LIBNAME)
real_clean: clean

View File

@ -66,7 +66,7 @@ $(LIBDIR)/$(LIBNAME): $(CPP_OBJECTS) | $(LIBDIR)
clean:
rm -rf $(OBJ_DIR)
rm -f $(LIBDIR)/$(LIBNAME)
rm -f $(LIBDIR)/$(LIBNAME)
real_clean: clean

View File

@ -23,29 +23,26 @@ APPDIRS = DPX \
Apps/ExternalPrograms
all: $(LIBDIRS) $(APPDIRS)
@ echo -e "\e[32mTrick data-products compiled:\e[34m" ; date ; echo -e "\e[0m"
@ echo "== Trick data_products make complete =="
.PHONY: $(LIBDIRS) $(APPDIRS)
$(LIBDIRS):
@ echo -e "\e[34m[---Building $@---]\e[0m"
@ echo ; echo "==: Compile data_products/$@"
@ $(MAKE) -C $@
@ echo ""
$(APPDIRS): $(LIBDIRS)
@ echo -e "\e[34m[---Building $@---]\e[0m"
@ echo ; echo "==: Compile data_products/$@"
@ $(MAKE) -C $@
@ echo ""
real_clean: clean
clean:
@ for i in $(LIBDIRS) ; do \
$(MAKE) -C $$i real_clean ; \
done
$(MAKE) -C $$i real_clean ; \
done
@ for i in $(APPDIRS) ; do \
$(MAKE) -C $$i real_clean ; \
done
$(MAKE) -C $$i real_clean ; \
done
@ rm -rf $(LIB_DIR)

View File

@ -47,7 +47,7 @@ $(LIBDIR)/$(LIBNAME): $(CPP_OBJECTS) $(C_OBJECTS) $(LIBDIR)
clean:
rm -rf $(OBJ_DIR)
rm -f $(LIBDIR)/$(LIBNAME)
rm -f $(LIBDIR)/$(LIBNAME)
real_clean: clean

View File

@ -24,12 +24,13 @@ RESOURCES = $(subst src/,,$(shell find src/trick -name resources))
RESOURCES += $(subst src/,,$(shell find src/trick -name jaxb.index))
all: ${DIST_DIR}/trick.jar resources
@ echo -e "\n\e[32mTrick GUIs compiled:\e[34m" ; date ; echo -e "\e[0m"
@echo "Java build successful"
${DEST_DIR} ${DIST_DIR} ${RESOURCES_DIR} ${DOCS_API_DIR}:
mkdir -p $@
${DIST_DIR}/trick.jar: compile ${DIST_DIR}
@echo "Creating jar file..."
@jar cf ${DIST_DIR}/trick.jar -C ${DEST_DIR} .
@cd ${SRC_DIR} && jar uf ${DIST_DIR}/trick.jar ${RESOURCES}
@ -37,6 +38,7 @@ external_jars:
@ $(MAKE) -C $(LIB_DIR)
compile: ${DEST_DIR} external_jars
@echo "Building Trick GUIs..."
@${JAVAC} ${JAVAC_FLAGS} -classpath ${CLASS_PATH} -d ${DEST_DIR} -sourcepath ${SRC_DIR} ${SRC_FILES}
resources: ${RESOURCES_DIR}/trick_icon.png

View File

@ -86,9 +86,12 @@ real_clean: clean
clean: clean_python
$(RM) -rf $(OBJ_DIR) $(TEST_DIR) $(PY_FILES)
clean_python:
rm -rf swig_${TRICK_HOST_CPU} sim_services.py swig_double.py swig_int.py swig_ref.py
real_clean: clean
# some depends
swig_int_wrap.cpp: swig_int.cpp
swig_double_wrap.cpp: swig_double.cpp