Reference: http://www.gnu.org/software/make/manual/make.html
Makefile:
#COMP = intel
C_FLAGS= -g -Wall
#C_FLAGS = -O2
BIN_DIR= $(HOME)/local/bin
NLIB = $(HOME)/proj/nlib
CXX = g++
F77 = gfortran
CXXFLAGS = $(C_FLAGS)
F77FLAGS = $(C_FLAGS) -ffixed-line-length-none
ifeq ($(COMP),intel)
CXX = icc
F77 = ifort
CXXFLAGS = $(C_FLAGS)
F77FLAGS = -O2 -132
endif
EXE = toi
...
# link
$(EXE): $(OBJS)
ifeq ($(COMP),intel)
$(F77) -nofor_main -cxxlib -o $@ $(OBJS) $(FLIBS)
else
$(CXX) $(CXXFLAGS) -I$(NLIB) -MMD -o $@ $(OBJS) $(FLIBS)
endif
No comments:
Post a Comment