source: PSPA/madxPSPA/make/README @ 447

Last change on this file since 447 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 5.1 KB
Line 
1# |
2# o---------------------------------------------------------------------o
3# |
4# | MAD makefile - documentation
5# |
6# o---------------------------------------------------------------------o
7# |
8# | Methodical Accelerator Design
9# |
10# | Copyright (c) 2011+ CERN, mad@cern.ch
11# |
12# | For more information, see http://cern.ch/mad
13# |
14# o---------------------------------------------------------------------o
15# |
16# | $Id$
17# |
18
19The MAD-X makefile is intended to compile project using C, C++ and Fortran 90
20compilers in a flexible way. The following sections explain how to configure
21the makefile for the project. Changing the value of a variable on the command
22line of make allows to setup different configuration for your project, including
23the user-defined files included for files selection (see Includes settings).
24
25targets for building the project:
26  [none] | $(PROJECT)$(ARCH)$(PROJEXT)
27
28targets for printing information:
29  info | infoinc | infoprj | infoall
30
31targets for cleaning generated files:
32  clean | cleandir | cleanc | cleancxx | cleanf90 | cleanbuild | cleanall
33
34makefile options:
35  - SHOW=yes displays commands executed by make instead of summary message
36
37###################
38# Project settings
39
40PROJECT sets the project name.
41  The program/library/archive will have the name $(PROJECT)$(ARCH)$(PROJEXT)
42
43Other flags can be added to configure the project.
44  Logical flags should use yes/no, not YES/NO
45
46#################
47# Build settings
48
49In the following settings, the first option is the default.
50
51ARCH=detect/32/64 sets the target platform archictecture
52  'detect' is replaced by 32/64 depending on platform architecture
53  The default target will have the name $(PROJECT)$(ARCH)
54  The program/library/archive will have the name $(PROJECT)$(ARCH)$(PROJEXT)
55
56DEBUG=yes/no sets/unsets the build for debugging (with dwarf-2 compliance)
57  adds -D_DEBUG to CPPFLAGS
58
59PROFILE=yes/no sets/unsets the build for profiling (with gprof compliance)
60  adds -D_PROFILE to CPPFLAGS
61
62STATIC=no/yes unsets/sets the build for static linking (for distribution)
63
64PLUGIN=no/yes unsets/sets the build for dynamic loading of plugins
65  adds -D_PLUGIN to CPPFLAGS
66
67###################################
68# Compilers/Linkers/Tester settings
69
70CC=gcc sets the name of the C compiler.
71  The settings of the compiler are included from the file make/compiler.$(CC)
72
73CXX=g++ sets the name of the C++ compiler.
74  The settings of the compiler are included from the file make/compiler.$(CXX)
75
76FC=gfortran sets the name of the F90 compiler.
77  The settings of the compiler are included from the file make/compiler.$(FC)
78
79LD=ld sets the name of the linker
80  The settings of the linker are included from the file make/linker.$(LD)
81
82ND=numdiff sets the name of the tester
83  The settings of the tester are included from the file make/tester.$(ND)
84
85Notes:
86  - The compiler, linker and tester configuration files are loaded using
87    $(makedir)/compiler.$([CC|CXX|FC]NAME)
88    $(makedir)/linker.$(LDNAME)
89    $(makedir)/tester.$(NDNAME)
90    where $([CC|CXX|FC|LD|ND]NAME) are set to $([CC|CXX|FC|LD|ND]) by default.
91  - In order to get the list of supported compilers, linkers and testers, do
92    ls -l $(makedir)/compiler.*
93    ls -l $(makedir)/linker.*
94    ls -l $(makedir)/tester.*
95    where usually $(makedir)=make.
96  - Example:
97      make FC=gfortran44 FCNAME=gfortran
98    sets the compiler to gfortran44 but uses the configuration of gfortran
99
100####################
101# Includes settings
102
103Makefile of the project to include (in this order, all are optional)
104  FILE_PRE  contains user's preprocessing extra stuffs
105  FILE_VER  contains the project VERSION and VERSION_DATE that must updated
106  FILE_CPP  contains extra CPPFLAGS define (-Dname[=value])
107  FILE_C    contains C   files selection and sets CC_SRC  and CC_HDR
108  FILE_CXX  contains C++ files selection and sets CXX_SRC and CXX_HDR
109  FILE_F90  contains F90 files selection and sets FC_SRC
110  FILE_LIB  sets LIBS with required paths (i.e. -Lpath) and names (i.e. -llib)
111  FILE_SYS  contains system specific stuff (e.g. unsupported configurations)
112  FILE_TEST contains project tests
113  FILE_POST contains user's postprocessing extra stuffs (e.g. special rules)
114
115Notes:
116  - dependencies of C and C++ files are computed automatically if possible
117  - dependencies of F90 are computed automatically if possible (often not)
118  - dependencies should be provided if resp. CDEP, CXXDEP, FCDEP are empty
119
120####################
121# Platform settings
122
123OSTYPE is set to the operating system name
124  One of Linux, Darwin, Cygwin, Windows
125
126OSARCH is set to the operating system architecture
127  One of i386, i686, x86, x86_64, amd64, ia64
128
129OBJDIR is set to $(OSTYPE)$(ARCH)
130  This is where the files generated by the build (e.g. .o, .d, .mod) are put
131  If APPENDLD=yes, then OBJDIR is set to $(OSTYPE)$(ARCH)_$(LDNAME)
132
133NOBUILD is a list of patterns specifying make target which do not make the build.
134  It is used to avoid automatic dependencies computation triggered by including
135  the .d files (i.e. rules for files dependencies) when they are not required.
136 
137####################
138# Tests settings
139
140TESTS is set to the list of test directories
141   tests must be present in the tests subdirectory and prefixed by test-
142
Note: See TracBrowser for help on using the repository browser.