diff --git a/build/autotools/common.am b/build/autotools/common.am index 475195a7..60c1d007 100644 --- a/build/autotools/common.am +++ b/build/autotools/common.am @@ -1,9 +1,20 @@ +# +# Define these variables from the beginning +# + +CLEANFILES = +SUFFIXES = + + +# +# Miscellaneous rules +# + lol_recursive_rule = \ @if test -n "$(SUBDIRS)"; then for subdir in $(SUBDIRS); do \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $(patsubst %-recursive, %, $@)) || exit 1; \ - done; \ - fi + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $(patsubst %-recursive, %, $@)) || exit 1; \ + done; fi bench: bench-recursive bench-recursive: @@ -46,7 +57,7 @@ lolfx_gen = $(lolfx_gen_$(V)) lolfx_gen_ = $(lolfx_gen_$(AM_DEFAULT_VERBOSITY)) lolfx_gen_0 = @echo " LOLFX " $@; -SUFFIXES = .lolfx +SUFFIXES += .lolfx .lolfx.o: $(lolfx_gen) $(AM_V_at)(echo "char const *"; \ @@ -56,6 +67,39 @@ SUFFIXES = .lolfx | $(CXXCOMPILE) -xc++ -c - -o $@ +# +# PS3 fself support rules +# + +fself_gen = $(fself_gen_$(V)) +fself_gen_ = $(fself_gen_$(AM_DEFAULT_VERBOSITY)) +fself_gen_0 = echo " FSELF " $${x}.self; +fself_gen_1 = echo make_fself $${x}$(EXEEXT) $${x}.self; + +all-local: all-local-ps3 +all-local-ps3: $(PROGRAMS) $(noinst_PROGRAMS) + @if test -n "$^"; then for x in $(^:%$(EXEEXT)=%); do \ + if test x$(MAKE_FSELF) != xno; then \ + $(fself_gen) \ + make_fself $${x}$(EXEEXT) $${x}.self; \ + fi; \ + done; fi + +CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.self) \ + $(PROGRAMS:%$(EXEEXT)=%.elf) \ + $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \ + $(noinst_PROGRAMS:%$(EXEEXT)=%.elf) + + +# +# Win32 rules +# + +# This is here in case we forget to make clean after a Windows build +CLEANFILES += $(PROGRAMS:%$(EXEEXT)=%.exe) \ + $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) + + # # Additional rules # diff --git a/configure.ac b/configure.ac index 29dbedf8..17ee4bb7 100644 --- a/configure.ac +++ b/configure.ac @@ -118,9 +118,11 @@ AC_CHECK_LIB(sysmodule_stub, cellSysmoduleLoadModule, LOL_LIBS="${LOL_LIBS} -lio_stub -lusbd_stub -lpadfilter" dnl Disable this warning, it's too verbose with vector.h CXXFLAGS="${CXXFLAGS} -Wno-sign-compare" - AC_PATH_PROG(MAKE_FSELF, make_fself, no)], + AC_PATH_PROG(MAKE_FSELF, make_fself, no) + if test "${MAKE_FSELF}" = "no"; then + AC_MSG_ERROR([[Building for PS3 but make_fself not found]]) + fi], [MAKE_FSELF=no]) -AM_CONDITIONAL(USE_MAKE_FSELF, test "${MAKE_FSELF}" != "no") AM_CONDITIONAL(USE_PS3, test "${ac_cv_my_have_ps3}" != "no") diff --git a/test/Makefile.am b/test/Makefile.am index 1c15047a..b67555df 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -8,15 +8,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src bench: benchsuite$(EXEEXT) ./benchsuite$(EXEEXT) -all-local: $(PROGRAMS) $(noinst_PROGRAMS) - for x in $(^:%$(EXEEXT)=%); do \ - test x$(MAKE_FSELF) = xno || make_fself $${x}$(EXEEXT) $${x}.self; \ - done - -CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.elf) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) - EXTRA_DIST = data/gradient.png noinst_PROGRAMS = benchsuite $(testsuite) btphystest diff --git a/test/math/Makefile.am b/test/math/Makefile.am index 5361b581..0c270d75 100644 --- a/test/math/Makefile.am +++ b/test/math/Makefile.am @@ -3,17 +3,8 @@ include $(top_srcdir)/build/autotools/common.am AM_CPPFLAGS = -I$(top_srcdir)/src -all-local: $(PROGRAMS) $(noinst_PROGRAMS) - for x in $(^:%$(EXEEXT)=%); do \ - test x$(MAKE_FSELF) = xno || make_fself $${x}$(EXEEXT) $${x}.self; \ - done - EXTRA_DIST = NEWS.txt lolremez.sln remez.vcxproj remez.vcxproj.filters -CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.elf) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) - noinst_PROGRAMS = pi poly remez pi_SOURCES = pi.cpp diff --git a/test/sandbox/Makefile.am b/test/sandbox/Makefile.am index 77fc4836..1178424a 100644 --- a/test/sandbox/Makefile.am +++ b/test/sandbox/Makefile.am @@ -3,13 +3,6 @@ include $(top_srcdir)/build/autotools/common.am AM_CPPFLAGS = -I$(top_srcdir)/src -all-local: $(noinst_PROGRAMS) - test x$(MAKE_FSELF) = xno || make_fself sample$(EXEEXT) sample.self - -CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.elf) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) - noinst_PROGRAMS = sample sample_SOURCES = sample.cpp diff --git a/test/xolotl/Makefile.am b/test/xolotl/Makefile.am index 3f4127ef..d39d3624 100644 --- a/test/xolotl/Makefile.am +++ b/test/xolotl/Makefile.am @@ -3,13 +3,6 @@ include $(top_srcdir)/build/autotools/common.am AM_CPPFLAGS = -I$(top_srcdir)/src -all-local: $(noinst_PROGRAMS) - test x$(MAKE_FSELF) = xno || make_fself xolotl$(EXEEXT) xolotl.self - -CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.elf) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) - noinst_PROGRAMS = xolotl xolotl_SOURCES = xolotl.cpp xolotl.h diff --git a/tutorial/Makefile.am b/tutorial/Makefile.am index 360dfce3..2e1629d8 100644 --- a/tutorial/Makefile.am +++ b/tutorial/Makefile.am @@ -3,15 +3,6 @@ include $(top_srcdir)/build/autotools/common.am AM_CPPFLAGS = -I$(top_srcdir)/src -all-local: $(PROGRAMS) $(noinst_PROGRAMS) - for x in $(^:%$(EXEEXT)=%); do \ - test x$(MAKE_FSELF) = xno || make_fself $${x}$(EXEEXT) $${x}.self; \ - done - -CLEANFILES = $(noinst_PROGRAMS:%$(EXEEXT)=%.self) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.elf) \ - $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) - noinst_PROGRAMS = 01_triangle 02_cube 03_noise 05_easymesh 08_fbo 11_fractal 01_triangle_SOURCES = 01_triangle.cpp 01_triangle.lolfx