# # # $Header$ # # Things common to both library and executable builds live in Makefile.common include $(HALLD_HOME)/src/BMS/Makefile.common .PHONY: all mkdirs depclean clean env # First rule. first: install #Make sure directories and dependancy files exist all: mkdirs $(LIBNAME)($(OBJS)) @rm -f $(DICT_FILES) ifeq ($(BMS_OSNAME),Darwin) ranlib $(LIBNAME) endif # To avoid errors if there are NO headers in a libraries source directory # (this happened with a FORTRAN library) we have to define the command # here. HEADERS := $(wildcard *.h) ifeq ($(HEADERS),) HEADER_CP_CMD = @echo "No Header Files to copy." else HEADER_CP_CMD = install -p $(HEADERS) $(INSTALL_DIR)/include/$(MODULE_NAME) endif mkdirs: mkdir -p $(LIB_DIR) mkdir -p $(DEP_DIR) install: all mkdir -p $(INSTALL_DIR)/lib/$(BMS_OSNAME) mkdir -p $(INSTALL_DIR)/include/$(MODULE_NAME) install -p $(LIBNAME) $(INSTALL_DIR)/lib/$(BMS_OSNAME) $(HEADER_CP_CMD) uninstall: rm -f $(INSTALL_DIR)/lib/$(BMS_OSNAME)/$(shell basename $(LIBNAME)) rm -rf $(INSTALL_DIR)/include/$(MODULE_NAME) depclean: rm -rf $(DEP_DIR) $(DICT_FILES) *.o *.bak *~ core last.kumac* #*# clean: rm -rf $(LIB_DIR) $(DEP_DIR) $(DICT_FILES) *.o *.bak *~ core last.kumac* #*# pristine: clean rm -rf .bin .obj .lib .depends # Rules to make DEPENDS files from source. Note that these are similar to the # rules in Makefile.bin, but use the implicit rules for archiving objects. $(DEP_DIR)/%.d : %.cpp mkdir -p $(DEP_DIR) $(DCXX) -MM -MT "$(LIBNAME)($(basename $@).o)" $(CXXFLAGS) $< > $@ $(DEP_DIR)/%.d : %.cc mkdir -p $(DEP_DIR) $(DCXX) -MM -MT "$(LIBNAME)($(basename $@).o)" $(CXXFLAGS) $< > $@ $(DEP_DIR)/%.d : %.cxx mkdir -p $(DEP_DIR) $(DCXX) -MM -MT "$(LIBNAME)($(basename $@).o)" $(CXXFLAGS) $< > $@ $(DEP_DIR)/%.d : %.c mkdir -p $(DEP_DIR) $(DCC) -MM -MT "$(LIBNAME)($(basename $@).o)" $(CFLAGS) $< > $@ $(DEP_DIR)/%.d : %.F mkdir -p $(DEP_DIR) $(DFC) -MM -MT "$(LIBNAME)($(basename $@).o)" $(FFLAGS) $< > $@ env: @echo FC = $(FC) @echo CC = $(CC) @echo CXX = $(CXX) @echo FFLAGS = $(FFLAGS) @echo CFLAGS = $(CFLAGS) @echo CXXFLAGS = $(CXXFLAGS) @echo FSRC = $(FSRC) @echo CSRC = $(CSRC) @echo CXXSRC = $(CXXSRC) @echo HEADERS = $(HEADERS) @echo HEADER_CP_CMD = $(HEADER_CP_CMD) @echo LIBS = $(LIBS) @echo BMS_OSNAME = $(BMS_OSNAME) @echo OBJS = $(OBJS) @echo MODULE_NAME = $(MODULE_NAME) @echo LIBNAME = $(LIBNAME) @echo LIB_DIR = $(LIB_DIR) @echo DEP_DIR = $(DEP_DIR) @echo INSTALL_DIR = $(INSTALL_DIR) @echo DEPS = $(DEPS) @echo PACKAGES = $(PACKAGES) @echo PACKAGE_MAKEFILES = $(PACKAGE_MAKEFILES) @echo DICT_DIRS = $(DICT_DIRS)