From c9e3bc77dac1b087c00a248d84140629b735d8a3 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Mon, 20 Jun 2016 13:40:45 -0500 Subject: [PATCH] er7_util header files not being installed Added a makefile install rule to copy the header files out of er7_utils to the install directory. Adjusted ICG to ignore Trick header files if they are installed. refs #246 --- Makefile | 67 ++++++++++--------- .../Interface_Code_Gen/HeaderSearchDirs.cpp | 11 ++- .../Interface_Code_Gen/PrintAttributes.cpp | 4 +- 3 files changed, 49 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 142cf02b..8b42e934 100644 --- a/Makefile +++ b/Makefile @@ -333,44 +333,51 @@ clean_gui: clean_java # INSTALL Targets ################################################################################ -install: +PREFIX := ${HOME}/temp2 +ER7_HEADERS := $(addprefix $(PREFIX)/include/, $(filter er7_utils/%, $(shell cd trick_source && find er7_utils -name \*.hh))) + +${ER7_HEADERS} : ${PREFIX}/include/% : trick_source/% + install -m 0644 -D $? $@ + +install: ${ER7_HEADERS} cp -r bin include $(notdir ${TRICK_LIB_DIR}) libexec share ${PREFIX} uninstall: - rm -f ${PREFIX}/bin/trick-* + rm -f ${PREFIX}/bin/trick-CP + rm -f ${PREFIX}/bin/trick-ICG + rm -f ${PREFIX}/bin/trick-dp + rm -f ${PREFIX}/bin/trick-dre + rm -f ${PREFIX}/bin/trick-gte + rm -f ${PREFIX}/bin/trick-gxplot + rm -f ${PREFIX}/bin/trick-jxplot + rm -f ${PREFIX}/bin/trick-killsim + rm -f ${PREFIX}/bin/trick-mm + rm -f ${PREFIX}/bin/trick-mtv + rm -f ${PREFIX}/bin/trick-qp + rm -f ${PREFIX}/bin/trick-sie + rm -f ${PREFIX}/bin/trick-simcontrol + rm -f ${PREFIX}/bin/trick-sniffer + rm -f ${PREFIX}/bin/trick-stripchart + rm -f ${PREFIX}/bin/trick-trk2ascii + rm -f ${PREFIX}/bin/trick-trk2csv + rm -f ${PREFIX}/bin/trick-tv + rm -f ${PREFIX}/bin/trick-version rm -rf ${PREFIX}/include/trick - rm -f ${PREFIX}/${BASE_LIB_DIR}/libtrick* + rm -rf ${PREFIX}/include/er7_utils + rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/liber7_utils.a + rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick.a + rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_comm.a + rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_math.a + rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_mm.a + rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_pyip.a + rm -f ${PREFIX}/$(notdir ${TRICK_LIB_DIR})/libtrick_units.a rm -rf ${PREFIX}/libexec/trick rm -rf ${PREFIX}/share/doc/trick - rm -f ${PREFIX}/share/man/man1/trick-* + rm -f ${PREFIX}/share/man/man1/trick-CP.1 + rm -f ${PREFIX}/share/man/man1/trick-ICG.1 + rm -f ${PREFIX}/share/man/man1/trick-killsim.1 rm -rf ${PREFIX}/share/trick -########### - -# These rules run the alternatives command in linux to create links in /usr/local/bin for Trick. -#ifeq ($(TRICK_HOST_TYPE),Linux) -#ALTERNATIVES := $(shell which alternatives || which update-alternatives) -# -#install: set_alternatives -#.PHONY: set_alternatives -#set_alternatives: copy_files -# - ${ALTERNATIVES} --install /usr/local/bin/CP trick ${PREFIX}/trick/trick-$(TRICK_VERSION)/bin/trick-CP 10 \ -# --slave /usr/local/bin/trick-ICG trick-ICG /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-ICG \ -# --slave /usr/local/bin/trick-gte trick-gte /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-gte \ -# --slave /usr/local/bin/trick-killsim trick-killsim /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-killsim \ -# --slave /usr/local/bin/trick-sie trick-sie /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-sie \ -# --slave /usr/local/bin/trick-sim_control trick-simcontrol /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-simcontrol \ -# --slave /usr/local/bin/trick-sniffer trick-sniffer /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-sniffer \ -# --slave /usr/local/bin/trick-dp trick-dp /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-dp \ -# --slave /usr/local/bin/trick-version trick-version /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-version \ -# --slave /usr/local/bin/trick-tv trick-tv /usr/local/trick/trick-$(TRICK_VERSION)/bin/trick-tv -# -#uninstall: remove_alternatives -#.PHONY: remove_alternatives -#remove_alternatives: -# - ${ALTERNATIVES} --remove trick ${PREFIX}/trick/trick-$(TRICK_VERSION)/bin/CP -#endif - ################################################################################ # MISCELLANEOUS DEVELOPER UTILITY TARGETS # ################################################################################ diff --git a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp index def46c0d..80764bf1 100644 --- a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp +++ b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp @@ -121,7 +121,12 @@ void HeaderSearchDirs::AddTrickSearchDirs () { std::string temp_dir = std::string(trick_home) + "/include/trick" ; char * resolved_path = almostRealPath(temp_dir.c_str() ) ; hso.AddPath(resolved_path , clang::frontend::Quoted, false, true); - trick_include_dir = std::string(resolved_path) ; + //trick_include_dir = std::string(resolved_path) ; + free(resolved_path) ; + + temp_dir = std::string(trick_home) + "/include/er7_utils" ; + resolved_path = almostRealPath(temp_dir.c_str() ) ; + hso.AddPath(resolved_path , clang::frontend::Quoted, false, true); free(resolved_path) ; temp_dir = std::string(trick_home) + "/trick_source" ; @@ -129,6 +134,10 @@ void HeaderSearchDirs::AddTrickSearchDirs () { hso.AddPath(resolved_path , clang::frontend::Quoted, false, true); trick_source_dir = std::string(resolved_path) ; free(resolved_path) ; + + temp_dir = std::string(trick_home) + "/include" ; + resolved_path = almostRealPath(temp_dir.c_str() ) ; + trick_include_dir = std::string(resolved_path) ; } } diff --git a/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp b/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp index 2c5da9c3..192f6cde 100644 --- a/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp +++ b/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp @@ -78,7 +78,7 @@ static void _mkdir(const char *dir) { if(*p == '/') { *p = 0; if ( stat( tmp , &buf ) != 0 ) { - if ( mkdir(tmp, S_IRWXU) != 0 ) { + if ( mkdir(tmp, S_IRWXU | S_IRWXG | S_IRWXO ) != 0 ) { std::cout << "Unable to create " << tmp << " for writing." << std::endl ; return ; } @@ -86,7 +86,7 @@ static void _mkdir(const char *dir) { *p = '/'; } if ( stat( tmp , &buf ) != 0 ) { - if ( mkdir(tmp, S_IRWXU) ) { + if ( mkdir(tmp, S_IRWXU | S_IRWXG | S_IRWXO) ) { std::cout << "Unable to create " << tmp << " for writing." << std::endl ; return ; }