File: Makefile

package info (click to toggle)
spark 2012.0.deb-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 29,260 kB
  • ctags: 3,098
  • sloc: ada: 186,243; cpp: 13,497; makefile: 685; yacc: 440; lex: 176; ansic: 119; sh: 16
file content (166 lines) | stat: -rw-r--r-- 5,393 bytes parent folder | download | duplicates (2)
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
# -----------------------------------------------------------------------------
#  (C) Altran Praxis Limited
# -----------------------------------------------------------------------------
# 
#  The SPARK toolset is free software; you can redistribute it and/or modify it
#  under terms of the GNU General Public License as published by the Free
#  Software Foundation; either version 3, or (at your option) any later
#  version. The SPARK toolset is distributed in the hope that it will be
#  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
#  Public License for more details. You should have received a copy of the GNU
#  General Public License distributed with the SPARK toolset; see file
#  COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy of
#  the license.
# 
# =============================================================================

################################################################################
# PURPOSE
#-------------------------------------------------------------------------------
# Makefile for the Examiner
# For Linux, Windows, Solaris or Mac OS X (aka Darwin).
################################################################################

################################################################################
# BUILD CONFIGURATION
################################################################################

# Name of the output program.
OUTPUT_NAME:=spark

# Location of root.
ROOT:=..

# Location of SPARKLALR parser generator binary
SPARKLALR:=${ROOT}/sparklalr/sparklalr

# Do not distribute files that must be prepped.
SPARK_PREPED:=examinerconstants.ads filesystem.adb

# Do not distribute files that are generated by the parser.
SPARK_PARSER:=sp_symbols.ads sp_parser_goto.adb sp_parser_goto.ads sp_relations.adb \
	sp_relations.ads sp_parser_actions.adb sp_parser_actions.ads \
	sp_productions.ads sp_expected_symbols.adb sp_expected_symbols.ads SPARK.PAR

FILES_GRAMMAR:=SPARK.LLA

# Location of common.
COMMON:=${ROOT}/common

include ${COMMON}/Makefile.inc

################################################################################
# PLATFORM INDEPENDENT CONFIGURATION
################################################################################

# Files containing platform specific code that is handled by gnatprep
PREP_TARGETS:=${SPARK_PREPED} \
	indexmanager-cache.adb indexmanager-cache.shb \
	sli-xref.adb sli-xref.shb

# Debug info file produced by sparklalr (so they can be cleaned up)
PARSER_DEBUG:=SPARK.DGN SPARK.DSC SPARK.EKO SPARK.SYM SPARK.ACT

GCC_OPTS:=-fstack-check

################################################################################
# PLATFORM SPECIFIC CONFIGURATION
################################################################################

# Windows.
ifeq (${TARGET},Windows)
    # The --stack option is Windows specific, and supports setting the
    # 'StackCommitSize' and 'StackReserveSize'.  The interpretation of
    # these values is not treated consistently across different
    # Windows versions. Experience and testing on various Windows
    # versions has led to the current stack size being set at:
    # 0x10000000,0x100000 Do not change this value without considering
    # its full ramifications.
    LINK_ARGS:=-Xlinker --stack=0x10000000,0x100000
endif

# Solaris.
ifeq (${TARGET},SunOS)
    LINK_ARGS:=
endif

# Linux.
ifeq (${TARGET},Linux)
    LINK_ARGS:=
endif

# Darwin (Mac OS X 10.5 or 10.6, 64-bit).
ifeq (${TARGET},Darwin)
    LINK_ARGS:=
endif

LINK_ARGS += ${ADA_LINK}

################################################################################
# TARGETS
################################################################################

all: ${OUTPUT_NAME}${EXE_EXTN}

${OUTPUT_NAME}${EXE_EXTN}: prep parser
	gnatmake -j${SPARKCPUS} ${GNATMAKE_OPTS} examiner -o $@ -cargs ${GCC_OPTS} -bargs ${BIND_OPTS} -largs ${LINK_ARGS}

self-analysis: prep parser
	-spark -report=mainunits95.rep -plain -dictionary_file=examiner @${OUTPUT_NAME}.smf

# Building parser
# ===============

parser: ${SPARK_PARSER}

${SPARK_PARSER}: ${FILES_GRAMMAR}
	# -p = Operate as parser
	# -s = Perform self-pack
	# -m = Accept multi comp
	# -v = Verbose
	# -du = Activate debug feature: dump memory
	${SPARKLALR} SPARK -p -s -m -v -du
	gnatchop -w SPARK.PAR

# Platform specific prepping
# ==========================

prep: ${PREP_TARGETS}

%.ads: %.aps
	gnatprep ${PREP_OPTS} -DTarget=${PREP_TARGET} -DAddress_Size=${ADDRESS_SIZE} $< $@

%.adb: %.apb
	gnatprep ${PREP_OPTS} -DTarget=${PREP_TARGET} -DAddress_Size=${ADDRESS_SIZE} $< $@

indexmanager-cache.adb: indexmanager-cache.SHADOW.adb
	gnatprep ${PREP_OPTS} -r -DSPARK=False $< $@

indexmanager-cache.shb: indexmanager-cache.SHADOW.adb
	gnatprep ${PREP_OPTS} -DSPARK=True $< $@

sli-xref.adb: sli-xref.SHADOW.adb
	gnatprep ${PREP_OPTS} -r -DSPARK=False $< $@

sli-xref.shb: sli-xref.SHADOW.adb
	gnatprep ${PREP_OPTS} -DSPARK=True $< $@

# Cleaning code base
# ==================

clean: residueclean standardclean

reallyclean: clean targetclean parserclean prepclean vcclean

residueclean:
	rm -f ${PARSER_DEBUG}

parserclean:
	rm -f ${SPARK_PARSER}

prepclean:
	rm -f ${PREP_TARGETS}

################################################################################
# END-OF-FILE