]>
Commit | Line | Data |
---|---|---|
efd81159 | 1 | dnl Copyright (C) 1997-2022 Free Software Foundation, Inc. |
760b3e8b MF |
2 | dnl |
3 | dnl This program is free software; you can redistribute it and/or modify | |
4 | dnl it under the terms of the GNU General Public License as published by | |
5 | dnl the Free Software Foundation; either version 3 of the License, or | |
6 | dnl (at your option) any later version. | |
7 | dnl | |
8 | dnl This program is distributed in the hope that it will be useful, | |
9 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | dnl GNU General Public License for more details. | |
12 | dnl | |
13 | dnl You should have received a copy of the GNU General Public License | |
14 | dnl along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | dnl | |
16 | dnl Generate the Makefile in a target specific directory. | |
17 | dnl Substitutions aren't performed on the file in AC_SUBST_FILE, | |
18 | dnl so this is a cover macro to tuck the details away of how we cope. | |
19 | dnl We cope by having autoconf generate two files and then merge them into | |
20 | dnl one afterwards. The two pieces of the common fragment are inserted into | |
21 | dnl the target's fragment at the appropriate points. | |
22 | AC_DEFUN([SIM_AC_OUTPUT], | |
23 | [dnl | |
760b3e8b MF |
24 | AC_CONFIG_FILES(Makefile.sim:Makefile.in) |
25 | AC_CONFIG_FILES(Make-common.sim:../common/Make-common.in) | |
760b3e8b MF |
26 | AC_CONFIG_COMMANDS([Makefile], |
27 | [echo "Merging Makefile.sim+Make-common.sim into Makefile ..." | |
28 | rm -f Makesim1.tmp Makesim2.tmp Makefile | |
29 | sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp | |
30 | sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp | |
31 | sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \ | |
32 | -e '/^## COMMON_POST_/ r Makesim2.tmp' \ | |
33 | <Makefile.sim >Makefile | |
34 | rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp | |
35 | ]) | |
36 | AC_CONFIG_COMMANDS([stamp-h], [echo > stamp-h]) | |
37 | ||
38 | dnl These are unfortunate. They are conditionally called by other sim macros | |
39 | dnl but always used by common/Make-common.in. So we have to subst here even | |
40 | dnl when the rest of the code is in the respective macros. | |
760b3e8b | 41 | AC_SUBST(sim_bitsize) |
760b3e8b | 42 | AC_SUBST(sim_float) |
760b3e8b | 43 | |
36bb57e4 MF |
44 | dnl Used by common/Make-common.in to see which configure script created it. |
45 | SIM_COMMON_BUILD_TRUE='#' | |
46 | SIM_COMMON_BUILD_FALSE= | |
47 | AC_SUBST(SIM_COMMON_BUILD_TRUE) | |
48 | AC_SUBST(SIM_COMMON_BUILD_FALSE) | |
49 | ||
760b3e8b MF |
50 | AC_OUTPUT |
51 | ]) |