1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
#
# Simple makefile for launching other makes to build all the ferret libraries
#
#
# Site-specific defines
#
include ../site_specific.mk
#
# include platform specific definitions of:
# CC, FC, RANLIB, CFLAGS, FFLAGS, PPLUS_FFLAGS
#
include ../platform_specific.mk.$(BUILDTYPE)
# Hard-code these for bit-reproducible builds
# PLATFORM := $(shell uname -rs)
# DATE := $(shell /bin/date +%D)
PLATFORM := Debian
DATE:= 6/30/16
#
# Macros
#
DIRS = ccr cferbind ctx dat doo efi efn ef_utility fmt gnl grdel \
ino mem plt pyf rpn stk utl xeq special
LIBS = ccr cferbind ctx dat doo efi efn ef_utility fmt gnl grdel \
ino mem plt pyf rpn stk utl xeq
#
# Targets
#
.PHONY : all
all: optimized
.PHONY : optimized
optimized:
$(MAKE) "CFLAGS = $(CFLAGS) $(OPT_FLAGS)" \
"FFLAGS = $(FFLAGS) $(OPT_FLAGS)" \
"PPLUS_FFLAGS = $(PPLUS_FFLAGS) $(PPLUS_OPT_FLAGS)" \
"VERSION_INFO = (optimized)" \
build
.PHONY : beta
beta:
$(MAKE) "CFLAGS = $(CFLAGS) $(OPT_FLAGS)" \
"FFLAGS = $(FFLAGS) $(OPT_FLAGS)" \
"PPLUS_FFLAGS = $(PPLUS_FFLAGS) $(PPLUS_OPT_FLAGS)" \
"VERSION_INFO = (beta/optim)" \
build
.PHONY : debug
debug:
$(MAKE) "CFLAGS = $(CFLAGS) $(DBG_FLAGS)" \
"FFLAGS = $(FFLAGS) $(DBG_FLAGS) -fbounds-check" \
"PPLUS_FFLAGS = $(PPLUS_FFLAGS) $(DBG_FLAGS)" \
"VERSION_INFO = (beta/debug)" \
build
## The definition of MEMORYDEBUG is observed by fer/special/FerMem_routines.c,
## which causes it to print (append) all memory allocations, reallocations,
## and frees to file "memorydebug.txt". Initialize allocated memory with
## non-zero values. Expect this to be a lot slower due to all the
## (intentionally inefficient but safe) file operations.
.PHONY : memorydebug
memorydebug:
$(MAKE) "CFLAGS = $(CFLAGS) $(DBG_FLAGS) -DMEMORYDEBUG" \
"FFLAGS = $(FFLAGS) $(DBG_FLAGS) -fbounds-check" \
"PPLUS_FFLAGS = $(PPLUS_FFLAGS) $(DBG_FLAGS)" \
"VERSION_INFO = (beta/debug)" \
build
## The definition of GRDELDEBUG is observed by fer/grdel, which causes it
## to create a grdeldebug.log file with all the graphics commands issued
.PHONY : grdeldebug
grdeldebug:
$(MAKE) "CFLAGS = $(CFLAGS) $(DBG_FLAGS) -DGRDELDEBUG" \
"FFLAGS = $(FFLAGS) $(DBG_FLAGS) -fbounds-check" \
"PPLUS_FFLAGS = $(PPLUS_FFLAGS) $(DBG_FLAGS)" \
"VERSION_INFO = (beta/debug)" \
build
.PHONY: profiling
profiling:
$(MAKE) "CFLAGS = $(CFLAGS) $(PROF_FLAGS) " \
"FFLAGS = $(FFLAGS) $(PROF_FLAGS) -fbounds-check" \
"PPLUS_FFLAGS = $(PPLUS_FFLAGS) $(PROF_FLAGS)" \
"LDFLAGS = $(LDFLAGS) $(PROF_FLAGS)" \
"VERSION_INFO = (profiling)" \
build
.PHONY : build
build: update special_code ppl_libraries fmt_libraries fer_libraries
.PHONY : update
update:
rm -f special/xmake_date_data.[Ffo]
sed "s&xxxxxxxx&$(DATE)&" < special/xmake_date_data.template > special/xmake_date_data.F
rm -f special/xrevision_type_data.[Ffo]
sed -e 's&mmmmmmmm&$(VERSION_INFO)&' -e 's&(/&(&' -e 's&/)&)&' < special/xrevision_type_data.template > special/xrevision_type_data.F
rm -f special/xplatform_type_data.[Ffo]
sed -e 's&mmmmmmmm&$(PLATFORM)&' -e 's&(/&(&' -e 's&/)&)&' < special/xplatform_type_data.template > special/xplatform_type_data.F
.PHONY : special_code
special_code: update
$(MAKE) -C special all
.PHONY : ppl_libraries
ppl_libraries:
$(MAKE) -C ../ppl
.PHONY : fmt_libraries
fmt_libraries:
$(MAKE) -C ../fmt/src
.PHONY : fer_libraries
fer_libraries: update
for i in $(LIBS) ; do \
if ! $(MAKE) -C $$i ; then \
exit 1 ; \
fi ; \
done
.PHONY : clean
clean: ppl_clean fmt_clean fer_clean
rm -f ../lib/*
.PHONY : ppl_clean
ppl_clean:
$(MAKE) -C ../ppl clean
.PHONY : fmt_clean
fmt_clean:
$(MAKE) -C ../fmt/src clean
.PHONY : fer_clean
fer_clean:
for i in $(DIRS) ; do \
$(MAKE) -C $$i clean ; \
done
rm -f special/xmake_date_data.F special/xrevision_type_data.F special/xplatform_type_data.F
#
# End of Makefile
#
|