1 # Makefile template for Configure for simulator common parts
2 # Copyright (C) 1996 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 srcroot
= $(srcdir)/..
/..
25 exec_prefix = @
exec_prefix@
27 host_alias
= @host_alias@
28 target_alias
= @target_alias@
29 program_transform_name
= @program_transform_name@
33 tooldir
= $(libdir)/$(target_alias
)
37 man1dir = $(mandir)/man1
39 includedir = @
includedir@
43 INSTALL
= $(srcroot
)/install.sh
-c
44 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
45 INSTALL_DATA
= @INSTALL_DATA@
46 INSTALL_XFORM
= $(INSTALL
) -t
='$(program_transform_name)'
47 INSTALL_XFORM1
= $(INSTALL_XFORM
) -b
=.1
50 CC_FOR_BUILD
= @CC_FOR_BUILD@
52 CPP_FOR_TARGET
= @CPP_FOR_TARGET@
53 TARGET_SUBDIR
= @TARGET_SUBDIR@
55 SIM_CFLAGS
= @sim_cflags@
60 CONFIG_CFLAGS
= @DEFS@
$(SIM_CFLAGS
) $(HDEFINES
) $(TDEFINES
)
61 CSEARCH
= -I.
-I
$(srcdir) -I
$(srcroot
)/include
62 ALL_CFLAGS
= $(CFLAGS
) $(CONFIG_CFLAGS
) $(CSEARCH
)
63 BUILD_CFLAGS
= -g
-O
$(CSEARCH
)
75 LIB_OBJS
= callback.o targ-map.o
77 # FIXME: Ideally, callback.o and friends live in a library outside of
78 # both the gdb and simulator source trees (e.g. devo/remote. Not
79 # devo/libremote because this directory would contain more than just
82 libcommon.a
: $(LIB_OBJS
)
84 $(AR
) $(ARFLAGS
) libcommon.a
$(LIB_OBJS
)
87 callback.o
: callback.c targ-vals.h
$(srcroot
)/include/callback.h
89 targ-map.o
: targ-map.c targ-vals.h
91 # Generate TARG_VALS_H for newlib using devo and build tree.
92 # This file is shipped with distributions so we build in the source dir.
93 # This is built in srcdir so putting dependencies here is risky.
94 # Use `make headers' to rebuild.
98 # Note: If gdb releases begin to contain target header files, generate
99 # targ-vals.def at build time.
101 nltvals.def
: Makefile gentvals.sh
104 rm -f nltvals.new
; \
105 echo
'/* Newlib macro values needed by simulator. */' >nltvals.new
; \
106 echo
'/* This file is machine generated by gentvalh.sh. */' >>nltvals.new
; \
107 $(SHELL
) $(srcdir)/gentvals.sh errno
$(srcroot
)/newlib
/libc
/include \
108 "errno.h sys/errno.h" 'E[A-Z0-9]*' "$(CPP_FOR_TARGET)" >>nltvals.new
; \
109 $(SHELL
) $(srcdir)/gentvals.sh signal
$(srcroot
)/newlib
/libc
/include \
110 "signal.h sys/signal.h" 'SIG[A-Z0-9]*' "$(CPP_FOR_TARGET)" >>nltvals.new
; \
111 $(SHELL
) $(srcdir)/gentvals.sh open
$(srcroot
)/newlib
/libc
/include \
112 "fcntl.h sys/fcntl.h" 'O_[A-Z0-9]*' "$(CPP_FOR_TARGET)" >>nltvals.new
; \
113 $(srcroot
)/move-if-change nltvals.new nltvals.def
115 gentmap
: Makefile gentmap.c
116 $(CC_FOR_BUILD
) $(srcdir)/gentmap.c
-o gentmap
$(BUILD_CFLAGS
)
118 targ-vals.h
: Makefile gentmap
120 .
/gentmap
-h
>targ-vals.h
122 targ-map.c
: Makefile gentmap
124 .
/gentmap
-c
>targ-map.c
127 $(CC
) -c
$< $(ALL_CFLAGS
)
141 rm -f
*.
[oa
] *~ core gentmap
144 distclean mostlyclean maintainer-clean
realclean: clean
146 rm -f Makefile config.cache config.log config.status
147 rm -f config.h stamp-h
149 # Dummy target to force execution of dependent targets.
152 # Copy the files into directories where they will be run.
156 $(INSTALL_XFORM1
) $(srcdir)/run
.1 $(man1dir)/run
.1
158 Makefile
: Makefile.in config.status
159 $(SHELL
) .
/config.status
161 config.status
: configure
162 $(SHELL
) .
/config.status
--recheck
164 # We can't add dependencies to configure because it causes too much trouble
165 # to end users if configure's timestamp is out of sync.
168 cd
$(srcdir) && autoconf
170 config.h
: stamp-h
; @true
171 stamp-h
: config.in config.status
172 CONFIG_FILES
= CONFIG_HEADERS
=config.h
:config.in
$(SHELL
) .
/config.status