#******************************************************************************\ # * # AASPI - Makefile * # * #******************************************************************************* # Copyright (C) AASPI by Kurt Marfurt, Ha Mai and Tim Kwiatkowski * #******************************************************************************/ # This is the Makefile for AASPI utility function library #******************************************************************************\ # USE: # # type 'gmake' to generate object files and link libraries # type 'gmake clean' to clean off previously compiled object files # type 'gmake install' to copy the EXECUTABLE_NAME to a directory called # EXECUTABLE_DIRECTORY (this path should be in your .cshrc file) #******************************************************************************/ ############################################################################### # # NOTE: This now builds the objects in a separate directory! # ############################################################################### #LINUX_AASPI_DIRECTORY = /home/aaspi/devel ############################################################################### # Include Global AASPI Makefile configuration include ../../Makefile.inc ############################################################################### LIBRARY_BASENAME=libaaspi_io # Set this to 'y' for shared library or 'n' for a static library #BUILD_SHARED_LIB = n ############################################################################### # Setup for 32 or 64 bit DO NOT EDIT THIS SECTION ifeq ($(AASPI_64_BIT),y) BUILD_DIR= obj64 AASPI_LIB_DIR=$(LINUX_AASPI_DIRECTORY)/lib64 F90_MODULE_DIR=$(LINUX_AASPI_DIRECTORY)/include64 else BUILD_DIR= obj32 AASPI_LIB_DIR=$(LINUX_AASPI_DIRECTORY)/lib F90_MODULE_DIR=$(LINUX_AASPI_DIRECTORY)/include endif ############################################################################### ############################################################################### #compilers and compiler options # #F90 = ifort32 ## Fortran 90 compiler #CC = gcc ## Gnu gcc compiler #CXX = g++ -m32 F77FLAGS = F90FLAGS = -module ${F90_MODULE_DIR} -O3 CFLAGS = CXXFLAGS = -Df2cFortran -g -O3 -Wall \ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ############################################################################### ############################################################################### # Header files to be copied to AASPI include directory ############################################################################### HEADER_FILES= aaspi_dict.h \ aaspi_file.h \ aaspi_file_info.h \ aaspi_file_io.h \ aaspi_framework.h \ aaspi_hist_file.h \ aaspi_interface.h \ aaspi_lexer.h \ aaspi_path.h \ aaspi_segy.h \ aaspi_process.h \ aaspi_types.h ############################################################################### # Define the Object files needed in this application ############################################################################### OBJS = aaspi_path.o \ aaspi_lexer.o \ aaspi_file_info.o \ aaspi_hist_file.o \ aaspi_file.o \ aaspi_framework.o \ aaspi_segy.o \ aaspi_interface.o \ aaspi_process.o BUILD_OBJS=$(addprefix $(BUILD_DIR)/,$(OBJS)) ############################################################################### INCLUDES= -I. ############################################################################### LIBS= ############################################################################### ############################################################################### # # Set up shared vs. static libraries -- DON'T EDIT THIS # ifndef BUILD_SHARED_LIB BUILD_SHARED_LIB = n endif ifeq ($(BUILD_SHARED_LIB),y) LDFLAGS := $(LDFLAGS) $(LDSHARED_FLAGS) LIBRARY_NAME := $(BUILD_DIR)/$(LIBRARY_BASENAME).so else LIBRARY_NAME := $(BUILD_DIR)/$(LIBRARY_BASENAME).a endif # # This is the main target -- Leave this alone as it makes the BUILD_DIR # all: $(BUILD_DIR) $(LIBRARY_NAME) # # Rules for building libraries # ifeq ($(BUILD_SHARED_LIB),y) # Dynamic library $(LIBRARY_NAME): $(BUILD_OBJS) $(LD) -o $@ $(LDFLAGS) $(BUILD_OBJS) else # Static library $(LIBRARY_NAME): $(BUILD_OBJS) $(AR) r $@ $? ranlib $@ endif ############################################################################### ############################################################################### $(BUILD_DIR): mkdir $(BUILD_DIR) $(BUILD_DIR)/%.o:%.f90 ${F90} $(F90FLAGS) $(INCLUDES) -c -o $@ $< $(BUILD_DIR)/%.o:%.cpp $(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< clean: echo erase the executable ${EXECUTABLE_NAME} and all *.o files rm -f $(BUILD_OBJS) $(LIBRARY_NAME) install: @echo @echo "------------------------------------" @echo "Install " @echo "------------------------------------" cp ${LIBRARY_NAME} ${AASPI_LIB_DIR} @echo @echo "Copying include files" cp $(HEADER_FILES) $(AASPI_INCLUDE_DIR) # Explicit depend rule f90_test.o: aaspi_mod.o ############################################################################### # DO NOT DELETE $(BUILD_OBJS)/aaspi_dict.o: aaspi_types.h $(BUILD_OBJS)/aaspi_file.o: aaspi_file_io.h aaspi_types.h aaspi_hist_file.h $(BUILD_OBJS)/aaspi_file.o: aaspi_lexer.h aaspi_dict.h $(BUILD_OBJS)/aaspi_file_info.o: aaspi_types.h $(BUILD_OBJS)/aaspi_file_io.o: aaspi_types.h $(BUILD_OBJS)/aaspi_framework.o: aaspi_types.h aaspi_dict.h aaspi_file.h $(BUILD_OBJS)/aaspi_framework.o: aaspi_file_io.h aaspi_hist_file.h $(BUILD_OBJS)/aaspi_framework.o: aaspi_lexer.h $(BUILD_OBJS)/aaspi_hist_file.o: aaspi_lexer.h aaspi_dict.h aaspi_types.h $(BUILD_OBJS)/aaspi_interface.o: aaspi_types.h cfortran.h $(BUILD_OBJS)/aaspi_segy.o: aaspi_types.h aaspi_file_io.h $(BUILD_OBJS)/aaspi_file.o: aaspi_file.h aaspi_file_io.h aaspi_types.h $(BUILD_OBJS)/aaspi_file.o: aaspi_hist_file.h aaspi_lexer.h aaspi_dict.h $(BUILD_OBJS)/aaspi_file.o: aaspi_path.h aaspi_file_info.h $(BUILD_OBJS)/aaspi_file_info.o: aaspi_file_info.h aaspi_types.h aaspi_path.h $(BUILD_OBJS)/aaspi_framework.o: aaspi_framework.h aaspi_types.h aaspi_dict.h $(BUILD_OBJS)/aaspi_framework.o: aaspi_file.h aaspi_file_io.h $(BUILD_OBJS)/aaspi_framework.o: aaspi_hist_file.h aaspi_lexer.h $(BUILD_OBJS)/aaspi_hist_file.o: aaspi_hist_file.h aaspi_lexer.h aaspi_dict.h $(BUILD_OBJS)/aaspi_hist_file.o: aaspi_types.h aaspi_framework.h aaspi_file.h $(BUILD_OBJS)/aaspi_hist_file.o: aaspi_file_io.h aaspi_file_info.h $(BUILD_OBJS)/aaspi_interface.o: aaspi_interface.h aaspi_types.h cfortran.h $(BUILD_OBJS)/aaspi_interface.o: aaspi_file.h aaspi_file_io.h $(BUILD_OBJS)/aaspi_interface.o: aaspi_hist_file.h aaspi_lexer.h aaspi_dict.h $(BUILD_OBJS)/aaspi_interface.o: aaspi_framework.h $(BUILD_OBJS)/aaspi_lexer.o: aaspi_lexer.h $(BUILD_OBJS)/aaspi_path.o: aaspi_path.h $(BUILD_OBJS)/aaspi_segy.o: aaspi_segy.h aaspi_types.h aaspi_file_io.h