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 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
|
# Makefile for Core Library
# $Id: Makefile,v 1.23 2004/11/08 17:56:04 exact Exp $
#################################################################
#
# Warning: this make file will best work with GNU's gmake
#
#################################################################
#################################################################
# Core Library Parameters
#################################################################
PACKAGE=core
VERSION=1.7 # official release will have x.y, and intermediate
# releases will be x.y.z (for z=1,2,etc)
CORE_PATH:=$(shell pwd)
CVSROOT=/home/exact/cvsroot
SUB_DIRS=src ext doc lib progs
# The following is needed to make sure that CC are properly
# for installing gmp
include Make.config
#################################################################
# gmp paths (Make your choice the last one)
#################################################################
gmp := gmp-3.1.1
gmp := gmp-4.0.1
gmp := gmp-4.1
gmp := gmp-4.1.2
gmp := gmp-4.1.4
#################################################################
# Default make target
#################################################################
# This default is used when you want to change the Core library
# without changing platform or gmp.
default: core
#################################################################
# Make everything in one step
#################################################################
# This makes both the gmp and core library
all: first second third testgmp fourth fifth
#################################################################
# Core Library Installation Steps
#################################################################
# First Step: configure for gmp
first configure:
@echo "Configure for GMP..."
-gzip -cd ${gmp}.tar.gz | tar xvf -
-cd ${gmp}; ./configure CC=${CC} ${GMP_ABI} --prefix=${GMP_PREFIX} 2>&1 \
| tee ${CORE_PATH}/tmp/DIAG_CONFIG
@echo "See file tmp/DIAG_CONFIG for screen output"
@echo ""
# Second Step: build gmp libraries
second gmp:
@echo "Build GMP Library..."
-${MAKE} -C ${gmp} 2>&1 | tee ${CORE_PATH}/tmp/DIAG_GMP
@echo "See file tmp/DIAG_GMP for screen output"
@echo ""
# Third Step: install gmp libraries and include files
third:
@echo "Install GMP Library..."
-${MAKE} -C ${gmp} install 2>&1 \
| tee ${CORE_PATH}/tmp/DIAG_GMPINSTALL
@echo "See file tmp/DIAG_GMPINSTALL for screen output"
@echo ""
# Fourth Step: build Core Library, Extensions and Sample Programs
fourth: core
#################################################################
# Test gmp
#################################################################
testgmp:
-${MAKE} -C ${CORE_PATH}/progs/generic testgmp \
2>&1 | tee ${CORE_PATH}/tmp/DIAG_TESTGMP
#################################################################
# Basic Core Functions
#################################################################
# This target is also useful when you need to re-compile the Core
# Library. Typically, you may need a "debugging version"
# of CORE (for the debugger to work). In this case, you set
# VAR=Debug in Make.config, and type "make core". This would
# create the library file "libcoreDebug.a" or "libcoreDebug.so".
core: corelib corex demo
# Make Core Library
corelib:
@echo "Build Core Library..."
-${MAKE} -C src 2>&1 | tee ${CORE_PATH}/tmp/DIAG_CORELIB
@echo "See file tmp/DIAG_CORELIB for screen output"
@echo ""
# Make Core Extension Library
corex:
@echo "Build Core Extension Library..."
-${MAKE} -C ext 2>&1 | tee ${CORE_PATH}/tmp/DIAG_COREX
@echo "See file tmp/DIAG_COREX for screen output"
@echo ""
# Make Sample Core Programs
demo: corelib corex
@echo "Build Sample Programs..."
-${MAKE} -C progs 2>&1 | tee ${CORE_PATH}/tmp/DIAG_BUILD_DEMO
@echo "See file tmp/DIAG_BUILD_DEMO for screen output"
@echo ""
# Run Test on Sample Core Programs
fifth test:
@echo "Testing Sample Programs..."
-${MAKE} -C progs test 2>&1 | tee ${CORE_PATH}/tmp/DIAG_TEST_DEMO
@echo "See file tmp/DIAG_TEST_DEMO for screen output"
@echo ""
# Basic Timing: just time all the tests
sixth time:
@echo "Timing Sample Programs..."
-time ${MAKE} test 2>&1 | tee ${CORE_PATH}/tmp/DIAG_TIME
@echo "See file tmp/DIAG_TIME for screen output"
@echo ""
# Run More Test on Sample Core Programs
seventh moretest:
@echo "More Testing of Sample Programs..."
-${MAKE} -C progs moretest 2>&1 | tee ${CORE_PATH}/tmp/DIAG_MORETEST_DEMO
@echo "See file tmp/DIAG_MORETEST_DEMO for screen output"
@echo ""
#################################################################
# Check Options
#################################################################
opt options check:
@echo "YOUR CURRENT CORE ENVIRONMENT VARIABLES ARE: "
@echo " PLATFORM: " ${PLATFORM}
@echo " LINKAGE: " ${LINKAGE}
@echo " VAR(iant): " ${VAR}
@echo " GMP_PREFIX: " ${GMP_PREFIX}
@echo " PACKAGE: " ${PACKAGE}
@echo " VERSION: " ${VERSION}
@echo " CORE_PATH: " ${CORE_PATH}
@echo " AR(chiver): " ${AR}
@echo " CC(compiler): " ${CC}
@echo " CXX(compiler): " ${CXX}
@echo " CXXFLAGS: " ${CXXFLAGS}
@echo " CORE_CXXFLAGS " ${CORE_CXXFLAGS}
@echo " LDFLAGS: " ${LDFLAGS}
@echo " CORE_LDFLAGS: " ${CORE_LDFLAGS}
@echo " EXETYPE: " ${EXETYPE}
@echo " OS: " ${OS}
allopt alloptions:
@echo "YOUR CURRENT CORE ENVIRONMENT VARIABLES ARE: "
@echo " (possible alternatives are listed in parenthesis)"
@echo ""
@echo " PLATFORM: " ${PLATFORM} " (cyg,gnu,sun,mingw,sgi)"
@echo " LINKAGE: " ${LINKAGE} " (static,shared)"
@echo " VAR(iant): " ${VAR} " (\"\",Debug,NoOpt)"
@echo " GMP_PREFIX: " ${GMP_PREFIX} " (..your choice..)"
@echo " PACKAGE: " ${PACKAGE}
@echo " VERSION: " ${VERSION}
@echo " CORE_PATH: " ${CORE_PATH}
@echo " AR(chiver): " ${AR}
@echo " CC(compiler): " ${CC}
@echo " CXX(compiler): " ${CXX}
@echo " CXXFLAGS: " ${CXXFLAGS} " (..compiler flags..)"
@echo " CORE_CXXFLAGS " ${CORE_CXXFLAGS}
@echo " LDFLAGS: " ${LDFLAGS} " (..load flags..)"
@echo " CORE_LDFLAGS: " ${CORE_LDFLAGS}
@echo " EXETYPE: " ${EXETYPE} " (\"\",.exe)"
@echo " OS: " ${OS} " (automatic)"
#################################################################
# Cleaning Up files
#################################################################
# clean_garbage: Remove all temp files
#
clean_garbage:
find . -name "*.exe.stackdump" -print | xargs -i \rm -rf {}
find . -name ii_files -print | xargs -i \rm -rf {}
find . -name SunWS_cache -print | xargs -i \rm -rf {}
find . -name "*\~" -print | xargs -i \rm -f {}
find . -name "typescript" -print | xargs -i \rm -f {}
# clean: Remove object files
# This is used if you want to compile a different version of the
# Core Library (but on the same platform)
#
clean:
@list='$(SUB_DIRS)'; for dir in $$list; do \
if test -d "$$dir"; then ${MAKE} -C "$$dir" clean; fi; \
done
# cleangmp: Clean the gmp directory only
# NOTE: to recover from this step, you need to do "make second" to
# recompile gmp. This is not cheap.
#
cleangmp:
-@${MAKE} -C ${gmp} clean
# veryclean: Remove executables as well as object files.
# This is done when you need to rebuild everything (e.g., you need
# to recompile the library for a new platform)
# "veryclean" subsumes "clean" (although this is somewhat implicit)
# but does not subsume "cleangmp" (which is expensive!)
# NOTE: after this step, you need to rebuild the Core Library from
# step "make third" and subsequent.
#
veryclean:
@list='$(SUB_DIRS)'; for dir in $$list; do \
if test -d "$$dir"; then ${MAKE} -C "$$dir" veryclean; fi; \
done
-@test -z "${CORE_PATH}/tmp/DIAG_*" || rm -f ${CORE_PATH}/tmp/DIAG_*
# superclean: clean everything
#
superclean: veryclean cleangmp
-@rm -rf ${CORE_PATH}/gmp
#################################################################
# Making Core Distributions
#################################################################
# commit all current changes to CVS
cvs commit:
cvs commit
# Make CVS-based distributions (base distribution and full distribution)
base:
(cd ..; cvs -d ${CVSROOT} co corelib; \
tar cFFvf - corelib | \
gzip -9 > ${PACKAGE}_v${VERSION}.tgz )
# Make CVS-based incremental distributions (gmp distribution and doc distribution)
full:
(cd ..; cvs -d ${CVSROOT} co corelib; \
cp ${gmp}.tar.gz corelib; \
tar cFFvf - corelib | \
gzip -9 > ${PACKAGE}_v${VERSION}.full.tgz )
#################################################################
# END OF CORE Makefile
#################################################################
|