Professional Documents
Culture Documents
SRC_DIR = $(TOP)/src/
###################################################
## ##
## OBJECTS is for source files used in both ##
## the slip and no-slip versions of the code ##
## ##
###################################################
#####################################################
## ##
## SLIP_OBJECTS is for source files used only in ##
## the slip version of the code ##
## ##
#####################################################
#######################################################
## ##
## NOSLIP_OBJECTS is for source files used only in ##
## the no-slip version of the code ##
## ##
#######################################################
#######################################################
## ##
## BOUNDARY_FLAG_OBJECTS is for source files used ##
## both the slip and no-slip versions of the code, ##
## but that require a flag to be set specifying ##
## which version of the code they are being ##
## compiled for ##
## ##
#######################################################
BOUNDARY_FLAG_OBJECTS = post_process.o
PROFILE = -pg
FLAGS = -g -lm
SLIP_FLAGS = -D SLIP
NOSLIP_FLAGS = -D NOSLIP
SLAPP = psg_slip
NSAPP = psg_noslip
CC = gcc
noslip : $(NSAPP)
$(OBJECTS) :
cd $(SRC_DIR); $(CC) $(FLAGS) -c $*.c $(PROFILE)
$(SLIP_OBJECTS) :
cd $(SRC_DIR); $(CC) $(FLAGS) -c $*.c $(PROFILE)
$(NOSLIP_OBJECTS) :
cd $(SRC_DIR); $(CC) $(FLAGS) -c $*.c $(PROFILE)
$(BOUNDARY_FLAG_OBJECTS) :
cd $(SRC_DIR); $(CC) $(FLAGS) $(SLIP_FLAGS) -c $*.c $(PROFILE)
@for file in $(subst .o,,$(BOUNDARY_FLAG_OBJECTS)); do \
mv $(SRC_DIR)/$$file.o $(SRC_DIR)/$$file\_slip.o ; \
done
cd $(SRC_DIR); $(CC) $(FLAGS) $(NOSLIP_FLAGS) -c $*.c $(PROFILE)
@for file in $(subst .o,,$(BOUNDARY_FLAG_OBJECTS)); do \
mv $(SRC_DIR)/$$file.o $(SRC_DIR)/$$file\_noslip.o ; \
done
clean :
rm -f psg_slip psg_noslip *.bin *.vtr; cd $(SRC_DIR); rm -f *.o *~ core*