1#    Makefile template for Configure for simulator common directory
2#    Copyright (C) 1996, 1997, 2007, 2008, 2009, 2010, 2011
3#    Free Software Foundation, Inc.
4# 
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18default: all
19
20VPATH = @srcdir@
21srcdir = @srcdir@
22srcroot = $(srcdir)/../..
23
24prefix = @prefix@
25exec_prefix = @exec_prefix@
26
27host_alias = @host_alias@
28target_alias = @target_alias@
29program_transform_name = @program_transform_name@
30bindir = @bindir@
31
32libdir = @libdir@
33tooldir = $(libdir)/$(target_alias)
34
35datarootdir = @datarootdir@
36datadir = @datadir@
37mandir = @mandir@
38man1dir = $(mandir)/man1
39infodir = @infodir@
40includedir = @includedir@
41
42SHELL = /bin/sh
43
44INSTALL = @INSTALL@
45INSTALL_PROGRAM = @INSTALL_PROGRAM@
46INSTALL_DATA = @INSTALL_DATA@
47
48CC = @CC@
49CC_FOR_BUILD = @CC_FOR_BUILD@
50CFLAGS = @CFLAGS@
51SIM_CFLAGS = @sim_cflags@
52
53# These are used to rebuild nltvals.def.
54CPP_FOR_TARGET = @CPP_FOR_TARGET@
55TARGET_SUBDIR = @TARGET_SUBDIR@
56
57HDEFINES = @HDEFINES@
58TDEFINES =
59
60CONFIG_CFLAGS = @DEFS@ $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES)
61CSEARCH = -I. -I$(srcdir) -I$(srcroot)/include
62ALL_CFLAGS = $(CFLAGS) $(CONFIG_CFLAGS) $(CSEARCH)
63BUILD_CFLAGS = -g -O $(CSEARCH)
64
65AR = @AR@
66AR_FLAGS = rc
67RANLIB = @RANLIB@
68MAKEINFO = makeinfo
69
70.NOEXPORT:
71MAKEOVERRIDES=
72
73all:
74
75# Generate nltvals.def for newlib/libgloss using devo and build tree.
76# This file is shipped with distributions so we build in the source dir.
77# Use `make headers' to rebuild.
78# Note: If gdb releases begin to contain target header files (not a good idea,
79# but if they did ...), targ-vals.def coud be generated at build time.
80# An alternative is to slurp in the tables at runtime.
81.PHONY: headers
82headers:
83	rootme=`pwd` ; \
84	cd $(srcdir) ; \
85	rm -f nltvals.new ; \
86	$(SHELL) $(srcdir)/gennltvals.sh $(SHELL) $(srcroot) "$(CPP_FOR_TARGET)" > nltvals.new ; \
87	$(SHELL) $(srcroot)/move-if-change nltvals.new nltvals.def
88
89.c.o:
90	$(CC) -c $< $(ALL_CFLAGS)
91
92check:
93
94info:
95clean-info:
96install-info:
97
98tags etags: TAGS
99
100# Macros like EXTERN_SIM_CORE confuse tags.
101# And the sim-n-foo.h files create functions that can't be found either.
102TAGS: force
103	cd $(srcdir) && \
104	etags --regex '/^\([a-z_]+\) (/\1/' --regex '/^.*\/[*] TAGS: .*/' \
105		*.c *.h
106
107clean:
108	rm -f *.[oa] *~ core
109
110distclean mostlyclean maintainer-clean realclean: clean
111	rm -f TAGS
112	rm -f Makefile config.cache config.log config.status
113	rm -f cconfig.h config.h stamp-h
114
115# Dummy target to force execution of dependent targets.
116force:
117
118# Copy the files into directories where they will be run.
119install: install-man
120
121install-man: installdirs
122	n=`echo run | sed '$(program_transform_name)'`; \
123	$(INSTALL_DATA) $(srcdir)/run.1 $(DESTDIR)$(man1dir)/$$n.1
124
125installdirs:
126	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(man1dir)
127
128Makefile: Makefile.in config.status
129	$(SHELL) ./config.status
130
131config.status: configure
132	$(SHELL) ./config.status --recheck
133
134config.h: stamp-h ; @true
135stamp-h: config.in config.status
136	CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
137