aboutsummaryrefslogtreecommitdiffstats
path: root/dist/gcc/Makefile.in
blob: a19725560f42073945c4e7ee19de29ecd5ee0655 (plain)
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
# Makefile for GNU vhdl Compiler (GHDL).
#   Copyright (C) 2002 Free Software Foundation, Inc.

#This file is part of GNU CC.

#GNU CC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.

#GNU CC 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
#along with GNU CC; see the file COPYING.  If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA.

# The makefile built from this file lives in the language subdirectory.
# It's purpose is to provide support for:
#
# 1) recursion where necessary, and only then (building .o's), and
# 2) building and debugging cc1 from the language subdirectory, and
# 3) nothing else.
#
# The parent makefile handles all other chores, with help from the
# language makefile fragment, of course.
#
# The targets for external use are:
# all, TAGS, ???mostlyclean, ???clean.

# This makefile will only work with Gnu make.
# The rules are written assuming a minimum subset of tools are available:
#
# Required:
#      MAKE:    Only Gnu make will work.
#      MV:      Must accept (at least) one, maybe wildcard, source argument,
#               a file or directory destination, and support creation/
#               modification date preservation.  Gnu mv -f works.
#      RM:      Must accept an arbitrary number of space separated file
#               arguments, or one wildcard argument. Gnu rm works.
#      RMDIR:   Must delete a directory and all its contents. Gnu rm -rf works.
#      ECHO:    Must support command line redirection. Any Unix-like
#               shell will typically provide this, otherwise a custom version
#               is trivial to write.
#      LN:      ln -s works, cp should work bu was not tested.
#      CP:      GNU cp -p works.
#      AR:      Gnu ar works.
#      MKDIR:   Gnu mkdir works.
#      CHMOD:   Gnu chmod works.
#      true:    Does nothing and returns a normal successful return code.
#      pwd:     Prints the current directory on stdout.
#      cd:      Change directory.

# Tell GNU make 3.79 not to run this directory in parallel.
# Not all of the required dependencies are present.
.NOTPARALLEL:

# Variables that exist for you to override.
# See below for how to change them for certain systems.

ALLOCA = 
# Various ways of specifying flags for compilations:  
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
# BOOT_CFLAGS is the value of CFLAGS to pass
# to the stage2 and stage3 compilations
# XCFLAGS is used for most compilations but not when using the GCC just built.
XCFLAGS =
CFLAGS = -g
BOOT_CFLAGS = -O $(CFLAGS)
# These exists to be overridden by the x-* and t-* files, respectively.
X_CFLAGS =
T_CFLAGS =

X_CPPFLAGS =
T_CPPFLAGS =

X_ADAFLAGS =
T_ADAFLAGS =

ADAC = $(CC)

ECHO = echo
CHMOD = chmod
CP = cp -p
MV = mv -f
RM = rm -f
RMDIR = rm -rf
MKDIR = mkdir -p
LN = ln -s
AR = ar
# How to invoke ranlib.
RANLIB = ranlib
# Test to use to see whether ranlib exists on the system.
RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
SHELL = /bin/sh
INSTALL_DATA = install -m 644
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
GNATBIND = gnatbind
GNATMAKE = gnatmake
ADA_CFLAGS = $(CFLAGS)
GHDL_ADAFLAGS = -Wall -gnata

LIBBACKTRACE = ../../libbacktrace/.libs/libbacktrace.a

objext = .o
exeext =
arext  = .a
soext  = .so
shext  =

HOST_CC=$(CC)
HOST_CFLAGS=$(ALL_CFLAGS)
HOST_CLIB=$(CLIB)
HOST_LDFLAGS=$(LDFLAGS)
HOST_CPPFLAGS=$(ALL_CPPFLAGS)
HOST_ALLOCA=$(ALLOCA)
HOST_MALLOC=$(MALLOC)
HOST_OBSTACK=$(OBSTACK)

# We don't use cross-make.  Instead we use the tools from the build tree,
# if they are available.
# program_transform_name and objdir are set by configure.in.
program_transform_name =
objdir = .

target=@target@
target_alias=@target_alias@
target_noncanonical:=@target_noncanonical@
xmake_file=@dep_host_xmake_file@
tmake_file=@dep_tmake_file@
#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`

# Directory where sources are, from where we are.
srcdir = @srcdir@
VPATH = @srcdir@

# Top build directory, relative to here.
top_builddir = ..

version := $(shell cat $(srcdir)/../BASE-VER)

# End of variables for you to override.

# Definition of `all' is here so that new rules inserted by sed
# do not specify the default target.
all:

# This tells GNU Make version 3 not to put all variables in the environment.
.NOEXPORT:


force:

SED=sed

clean: grt-clean ghdllibs-clean force
	$(RM) *.o *.ali

# Additionnal rules

LIBSRC_DIR:=$(srcdir)/libraries
LIBDST_DIR:=lib
ANALYZE=../../../../ghdl -a --GHDL1=./ghdl1 --ieee=none $(LIB_CFLAGS)
ANALYZE_DEP:=

####libraries Makefile.inc

ANALYZE_STD=$(GHDL1) -quiet --compile-standard $(LIB_CFLAGS)

std87_standard.o: $(GHDL1)
	$(ANALYZE_STD) --std=87 -o std87_standard.s
	../xgcc -c -o $@ std87_standard.s
	$(RM) -f std87_standard.s

std93_standard.o: $(GHDL1)
	$(ANALYZE_STD) --std=93 -o std93_standard.s
	../xgcc -c -o $@ std93_standard.s
	$(RM) -f std93_standard.s

std08_standard.o: $(GHDL1)
	$(ANALYZE_STD) --std=08 -o std08_standard.s
	../xgcc -c -o $@ std08_standard.s
	$(RM) -f std08_standard.s

ghdllib: std87_standard.o std93_standard.o std08_standard.o vhdl.libs.all

ghdllibs-clean: force
	$(RM) -rf $(LIB87_DIR) $(LIB93_DIR) $(LIB08_DIR)

PHONY: ghdllib ghdllibs-clean

GHDL1=../ghdl1
GRTSRCDIR=$(srcdir)/grt
GRT_RANLIB=$(RANLIB)

####grt Makefile.inc

install-ghdllib:
	$(RM) -rf $(DESTDIR)$(VHDL_LIB_DIR)
	$(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)
# Install libgrt
	$(INSTALL_DATA) libgrt.a $(DESTDIR)$(VHDL_LIB_DIR)/libgrt.a
	$(INSTALL_DATA) grt.lst $(DESTDIR)$(VHDL_LIB_DIR)/grt.lst
	$(INSTALL_DATA) $(GRTSRCDIR)/grt.ver $(DESTDIR)$(VHDL_LIB_DIR)/grt.ver
	$(INSTALL_DATA) $(LIBBACKTRACE) $(DESTDIR)$(VHDL_LIB_DIR)/libbacktrace.a
# Install VHDL sources.
	for d in $(VHDLLIB_SUBDIRS); do \
	  $(MKDIR) -p $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
	  $(INSTALL_DATA) -p \
	    $(LIBDST_DIR)/$$d/* $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
	done
# Copy std_standard (this is done after libraries, since they remove dirs).
	$(INSTALL_DATA) std87_standard.o \
	  $(DESTDIR)$(VHDL_LIB_DIR)/v87/std/std_standard.o
	$(INSTALL_DATA) std93_standard.o \
	  $(DESTDIR)$(VHDL_LIB_DIR)/v93/std/std_standard.o
	$(INSTALL_DATA) std08_standard.o \
	  $(DESTDIR)$(VHDL_LIB_DIR)/v08/std/std_standard.o
# Install vendors scripts.
	$(MKDIR) -p $(DESTDIR)$(VHDL_LIB_DIR)/vendors
	$(INSTALL_DATA) -p \
	  $(LIBSRC_DIR)/vendors/* $(DESTDIR)$(VHDL_LIB_DIR)/vendors/
	$(INSTALL_PROGRAM) -p \
	  $(LIBSRC_DIR)/vendors/*.sh $(DESTDIR)$(VHDL_LIB_DIR)/vendors/