Skip to content

Commit

Permalink
Put generated source files in srcdir to avoid constant recompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
phabrics committed Mar 12, 2024
1 parent c926fae commit a4ecc4a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
11 changes: 7 additions & 4 deletions generic/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,22 @@ $(noinst_SCRIPTS): %.sh: %.m4
$(AUTOM4TE) -l m4sh $< > $@

# target to make float-auto.c and bus-device-auto.c:
float-auto.c bus-device-auto.c: %.c: %.sh
$(srcdir)/float-auto.c: float-auto.sh
$(SHELL) $< > $@

$(srcdir)/bus-device-auto.c: bus-device-auto.sh
$(SHELL) $< > $@

# target to make fb-xlat-auto.c:
if USING_X
fb-xlat-auto.c: %.c: %.sh %.in
$(srcdir)/fb-xlat-auto.c: fb-xlat-auto.sh fb-xlat-auto.in
cat $*.in | xargs $(SHELL) $< > $@

fb-xlat-auto.in: %.in: %.pl
fb-xlat-auto.in: fb-xlat-auto.pl
$(PERL) $< src $(TME_FB_XLAT_SRC) dst $(TME_FB_XLAT_DST) > $@ || \
echo "src $(TME_FB_XLAT_SRC) dst $(TME_FB_XLAT_DST)" > $@
else
fb-xlat-auto.c: %.c: %.sh
$(srcdir)/fb-xlat-auto.c: fb-xlat-auto.sh
$(SHELL) $< src $(TME_FB_XLAT_SRC) dst $(TME_FB_XLAT_DST) > $@
endif

Expand Down
8 changes: 4 additions & 4 deletions ic/ieee754/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ $(noinst_SCRIPTS): %.sh: %.m4
$(AUTOM4TE) -l m4sh $< > $@

# target to make ieee754-auto.h:
ieee754-auto.h: ieee754-misc-auto.sh ieee754-precision.sh
$(srcdir)/ieee754-auto.h: ieee754-misc-auto.sh ieee754-precision.sh
$(SHELL) $< --header > $@

# target to make ieee754-misc-auto.c:
ieee754-misc-auto.c: ieee754-misc-auto.sh ieee754-precision.sh
$(srcdir)/ieee754-misc-auto.c: ieee754-misc-auto.sh ieee754-precision.sh
$(SHELL) $< > $@

# target to make ieee754-ops-auto.h:
ieee754-ops-auto.h: ieee754-ops-auto.sh ieee754-precision.sh
$(srcdir)/ieee754-ops-auto.h: ieee754-ops-auto.sh ieee754-precision.sh
$(SHELL) $< --header > $@

# target to make ieee754-ops-auto.c:
ieee754-ops-auto.c: ieee754-ops-auto.sh ieee754-precision.sh
$(srcdir)/ieee754-ops-auto.c: ieee754-ops-auto.sh ieee754-precision.sh
$(SHELL) $< > $@

include $(top_srcdir)/modules
22 changes: 11 additions & 11 deletions ic/m68k/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ $(noinst_SCRIPTS): %.sh: %.m4
$(AUTOM4TE) -l m4sh $< > $@

# target to make m68k-auto.h:
m68k-auto.h: m68k-misc-auto.sh m68k-insns-auto.sh
$(srcdir)/m68k-auto.h: m68k-misc-auto.sh m68k-insns-auto.sh
$(SHELL) $< --header > $@
$(SHELL) $(srcdir)/m68k-insns-auto.sh --header >> $@
$(SHELL) m68k-insns-auto.sh --header >> $@

# target to make m68k-opmap.c:
m68k-opmap.c: m68k-iset.txt m68k-iset-expand.pl m68k-opmap-make.pl
( $(PERL) $(srcdir)/m68k-iset-expand.pl m68000 < $(srcdir)/m68k-iset.txt ; \
$(PERL) $(srcdir)/m68k-iset-expand.pl m68010 < $(srcdir)/m68k-iset.txt ; \
$(PERL) $(srcdir)/m68k-iset-expand.pl m68020 < $(srcdir)/m68k-iset.txt ) | \
$(PERL) $(srcdir)/m68k-opmap-make.pl > $@
$(srcdir)/m68k-opmap.c: m68k-iset.txt m68k-iset-expand.pl m68k-opmap-make.pl
( $(PERL) m68k-iset-expand.pl m68000 < m68k-iset.txt ; \
$(PERL) m68k-iset-expand.pl m68010 < m68k-iset.txt ; \
$(PERL) m68k-iset-expand.pl m68020 < m68k-iset.txt ) | \
$(PERL) m68k-opmap-make.pl > $@

# target to make m68k-insns-auto.c:
m68k-insns-auto.c: m68k-insns-auto.sh m68k-misc-auto.sh
$(srcdir)/m68k-insns-auto.c: m68k-insns-auto.sh m68k-misc-auto.sh
$(SHELL) $< > $@
$(SHELL) $(srcdir)/m68k-misc-auto.sh >> $@
$(SHELL) m68k-misc-auto.sh >> $@

# target to make m68k-bus-auto.c:
m68k-bus-auto.c: m68k-bus-auto.sh
$(srcdir)/m68k-bus-auto.c: m68k-bus-auto.sh
$(SHELL) $< > $@

# target to make m6888x-auto.c:
m6888x-auto.c: m6888x-auto.sh
$(srcdir)/m6888x-auto.c: m6888x-auto.sh
$(SHELL) $< > $@

# dependencies on automatically-generated IEEE 754 sources:
Expand Down
14 changes: 7 additions & 7 deletions ic/sparc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ $(noinst_SCRIPTS): %.sh: %.m4
$(AUTOM4TE) -l m4sh $< > $@

# target to make sparc-auto.h:
sparc-auto.h: sparc-misc-auto.sh sparc-insns-auto.sh
$(srcdir)/sparc-auto.h: sparc-misc-auto.sh sparc-insns-auto.sh
$(SHELL) $< --header > $@
$(SHELL) $(srcdir)/sparc-insns-auto.sh --header >> $@
$(SHELL) sparc-insns-auto.sh --header >> $@

# target to make sparc-insns-auto.c:
sparc-insns-auto.c: sparc-insns-auto.sh sparc-misc-auto.sh
$(srcdir)/sparc-insns-auto.c: sparc-insns-auto.sh sparc-misc-auto.sh
$(SHELL) $< > $@
$(SHELL) $(srcdir)/sparc-misc-auto.sh >> $@
$(SHELL) sparc-misc-auto.sh >> $@

# target to make sparc-bus-auto.c:
sparc-bus-auto.c: sparc-bus-auto.sh
$(srcdir)/sparc-bus-auto.c: sparc-bus-auto.sh
$(SHELL) $< > $@

# target to make sparc-fpu-auto.c:
sparc-fpu-auto.c: sparc-fpu-auto.sh
$(srcdir)/sparc-fpu-auto.c: sparc-fpu-auto.sh
$(SHELL) $< > $@

# target to make sparc-vis-auto.c:
sparc-vis-auto.c: sparc-vis-auto.sh
$(srcdir)/sparc-vis-auto.c: sparc-vis-auto.sh
$(SHELL) $< > $@

# dependencies on automatically-generated IEEE 754 sources:
Expand Down
4 changes: 2 additions & 2 deletions libtme/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ $(noinst_SCRIPTS): %.sh: %.m4
$(AUTOM4TE) -l m4sh $< > $@

# target to make memory-auto.h:
memory-auto.h: memory-auto.sh
$(srcdir)/memory-auto.h: memory-auto.sh
$(SHELL) $< --header > $@

# target to make memory-auto.c:
memory-auto.c: memory-auto.sh
$(srcdir)/memory-auto.c: memory-auto.sh
$(SHELL) $< > $@

module.c: $(top_builddir)/tme/shlibvar.h

0 comments on commit a4ecc4a

Please sign in to comment.