xref: /netbsd-src/external/gpl3/gdb/dist/sim/erc32/local.mk (revision 2dd295436a0082eb4f8d294f4aa73c223413d0f2)
1## See sim/Makefile.am
2##
3## Copyright (C) 1993-2023 Free Software Foundation, Inc.
4## Written by Cygnus Support
5## Modified by J.Gaisler ESA/ESTEC
6##
7## This program is free software; you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation; either version 3 of the License, or
10## (at your option) any later version.
11##
12## This program is distributed in the hope that it will be useful,
13## but WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15## GNU General Public License for more details.
16##
17## You should have received a copy of the GNU General Public License
18## along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20%C%_run_SOURCES =
21%C%_run_LDADD = \
22	%D%/sis.o \
23	%D%/libsim.a \
24	$(SIM_COMMON_LIBS) $(READLINE_LIB) $(TERMCAP_LIB)
25
26%D%/sis$(EXEEXT): %D%/run$(EXEEXT)
27	$(AM_V_GEN)ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
28
29## Helper targets for running make from the top-level due to run's sis.o.
30%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
31	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
32
33noinst_PROGRAMS += %D%/run %D%/sis
34
35%C%docdir = $(docdir)/%C%
36%C%doc_DATA = %D%/README.erc32 %D%/README.gdb %D%/README.sis
37
38SIM_INSTALL_EXEC_LOCAL_DEPS += sim-%D-install-exec-local
39sim-%D-install-exec-local: installdirs
40	$(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
41	n=`echo sis | sed '$(program_transform_name)'`; \
42	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) %D%/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
43
44SIM_UNINSTALL_LOCAL_DEPS += sim-%D%-uninstall-local
45sim-%D%-uninstall-local:
46	rm -f $(DESTDIR)$(bindir)/sis
47