star-sf

Set of surface and volume scattering functions
git clone git://git.meso-star.fr/star-sf.git
Log | Files | Refs | README | LICENSE

commit b8bd92ebab26b7bbc6d93af293969676fa3f5386
parent fc920abc6f91fa0727bb540891cd70eb229dd350
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 19 Jul 2023 17:56:51 +0200

Clean dynamic handling of SIMD_WIDTH macro

Diffstat:
MMakefile | 23++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile @@ -69,7 +69,7 @@ $(LIBNAME_STATIC): $(OBJ) $(AR) -rc $@ $? $(RANLIB) $@ -.config__: config.mk .simd +.config: config.mk .simd @if [ "$(SIMD_WIDTH)" = "128" ] || [ "$(SIMD_WIDTH)" = "256" ]; then \ if ! $(PKG_CONFIG) --atleast-version $(RSIMD_VERSION) rsimd; then \ echo "rsimd $(RSIMD_VERSION) not found"; exit 1; fi; fi @@ -77,7 +77,7 @@ $(LIBNAME_STATIC): $(OBJ) echo "rsys $(RSYS_VERSION) not found"; exit 1; fi @if ! $(PKG_CONFIG) --atleast-version $(SSP_VERSION) star-sp; then \ echo "star-sp $(SSP_VERSION) not found"; exit 1; fi - @echo "config done" > .config + @echo "config done" > $@ .simd: make.sh config.mk @$(SHELL) make.sh config_simd > $@ @@ -103,7 +103,7 @@ distclean: clean lint: shellcheck -o all make.sh -.config build_library pkg ssf-local.pc: .simd +build_library build_tests pkg: .simd @$(MAKE) -f.simd -fMakefile $@__ ################################################################################ @@ -123,8 +123,7 @@ pkg__: -e 's#@SIMD@#$(PKG_SIMD)#g'\ ssf.pc.in > ssf.pc -ssf-local.pc: ssf.pc.in -ssf-local.pc__: +ssf-local.pc: ssf.pc.in .simd @sed -e '1d'\ -e 's#^includedir=.*#includedir=./src/#'\ -e 's#^libdir=.*#libdir=./#'\ @@ -132,7 +131,7 @@ ssf-local.pc__: -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\ -e 's#@SSP_VERSION@#$(SSP_VERSION)#g'\ -e 's#@SIMD@#$(PKG_SIMD)#g'\ - ssf.pc.in > ssf-local.pc + ssf.pc.in > $@ install: build_library pkg @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib" $(LIBNAME) @@ -178,7 +177,7 @@ PKG_CONFIG_LOCAL = PKG_CONFIG_PATH="./:$${PKG_CONFIG_PATH}" $(PKG_CONFIG) SSF_CFLAGS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --cflags ssf-local.pc) SSF_LIBS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --libs ssf-local.pc) -build_tests: build_library $(TEST_DEP) .test +build_tests__: build_library $(TEST_DEP) .test ssf-local.pc @$(MAKE) -fMakefile -f.test $$(for i in $(TEST_DEP); do echo -f"$${i}"; done) test_bin test: build_tests .simd @@ -190,7 +189,12 @@ test: build_tests .simd clean_test: @$(SHELL) make.sh clean_test $(TEST_SRC) -$(TEST_DEP) $(TEST_OBJ): config.mk +$(TEST_DEP): config.mk ssf-local.pc + @$(CC) $(CFLAGS) $(RSYS_CFLAGS) $(SSF_CFLAGS) $(SSP_CFLAGS) -MM -MT \ + "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ + +$(TEST_OBJ): config.mk ssf-local.pc + $(CC) $(CFLAGS) $(RSYS_CFLAGS) $(SSF_CFLAGS) $(SSP_CFLAGS) -c $(@:.o=.c) -o $@ test_ssf_beckmann_distribution \ test_ssf_blinn_distribution \ @@ -214,6 +218,3 @@ test_ssf_specular_reflection \ test_ssf_thin_specular_dielectric \ : config.mk ssf-local.pc $(CC) -o $@ src/$@.o $(RSYS_LIBS) $(SSF_LIBS) $(SSP_LIBS) -lm - -$(TEST_OBJ): ssf-local.pc - $(CC) $(CFLAGS) $(RSYS_CFLAGS) $(SSF_CFLAGS) $(SSP_CFLAGS)-c $(@:.o=.c) -o $@