local.mk 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ## See sim/Makefile.am
  2. ##
  3. ## Copyright (C) 1990-2022 Free Software Foundation, Inc.
  4. ## Written by Cygnus Support.
  5. ##
  6. ## This program is free software; you can redistribute it and/or modify
  7. ## it under the terms of the GNU General Public License as published by
  8. ## the Free Software Foundation; either version 3 of the License, or
  9. ## (at your option) any later version.
  10. ##
  11. ## This program is distributed in the hope that it will be useful,
  12. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ## GNU General Public License for more details.
  15. ##
  16. ## You should have received a copy of the GNU General Public License
  17. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. %C%_BUILD_OUTPUTS = \
  19. %D%/gencode$(EXEEXT) \
  20. %D%/code.c \
  21. %D%/ppi.c \
  22. %D%/table.c
  23. ## This makes sure build tools are available before building the arch-subdirs.
  24. SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
  25. %C%_gencode_SOURCES = %D%/gencode.c
  26. # These rules are copied from automake, but tweaked to use FOR_BUILD variables.
  27. %D%/gencode$(EXEEXT): $(%C%_gencode_OBJECTS) $(%C%_gencode_DEPENDENCIES) %D%/$(am__dirstamp)
  28. $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_gencode_OBJECTS) $(%C%_gencode_LDADD)
  29. # gencode is a build-time only tool. Override the default rules for it.
  30. %D%/gencode.o: %D%/gencode.c
  31. $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
  32. %D%/code.c: %D%/gencode$(EXEEXT)
  33. $(AM_V_GEN)$< -x >$@
  34. %D%/ppi.c: %D%/gencode$(EXEEXT)
  35. $(AM_V_GEN)$< -p >$@
  36. %D%/table.c: %D%/gencode$(EXEEXT)
  37. $(AM_V_GEN)$< -s >$@
  38. EXTRA_PROGRAMS += %D%/gencode
  39. MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)