star-3d

Surface structuring for efficient 3D geometric queries
git clone git://git.meso-star.fr/star-3d.git
Log | Files | Refs | README | LICENSE

commit a6e4608a75495a31c6e746ac0367603e6e3911c5
parent 2671ddde4b1c4263725cca888c395a6135ee1e67
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Sun, 14 May 2023 15:50:09 +0200

Rename some Makefile macros

Rename PKG_FLAGS to PCFLAGS for "Pkg-Config FLAGS". By removing the
underscore and compressing the name, we adopt the same naming convention
used for other flags such as CFLAGS (Compiler FLAGS), SOFLAGS (Shared
Object FLAGS) or LDFLAGS (LoaD FLAGS).

The <PACKAGE>_INC and <PACKAGE>_LIB macros are renamed to
<PACKAGE>_CFLAGS and <PACKAGE>_LIBS to refer to the properties of the
queried packages. In addition, INC stood for include or inclusion while
the corresponding macros could have more options than just the include
directives. Finally, while LIB was singular, a package could provide
more than one library.

The CFLAGS and LIBS lists of all dependencies are finally renamed
DPDC_CFLAGS and DPDC_LIBS instead of INCS and LIBS, with DPDC meaning
DePenDenCies. We chose the prefix DPDC rather than DEP or DEPS to avoid
confusion with the .d files already referenced by the DEP macro.

Diffstat:
MMakefile | 12++++++------
Mconfig.mk | 18+++++++++---------
2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile @@ -64,13 +64,13 @@ build_library: .config $(DEP) $(OBJ): config.mk $(LIBNAME_SHARED): $(OBJ) - $(CC) -std=c99 $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(SOFLAGS) $(LIBS) + $(CC) -std=c99 $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(SOFLAGS) $(DPDC_LIBS) $(LIBNAME_STATIC): $(OBJ) $(AR) -rc $@ $? $(RANLIB) $@ -.config: Makefile +.config: Makefile config.mk @if ! $(PKG_CONFIG) --atleast-version $(RSYS_VERSION) rsys; then\ echo "rsys $(RSYS_VERSION) not found" >&2; exit 1; fi @if ! $(PKG_CONFIG) --atleast-version $(EMBREE_VERSION) embree4; then\ @@ -79,10 +79,10 @@ $(LIBNAME_STATIC): $(OBJ) .SUFFIXES: .c .d .o .c.d: - @$(CC) -std=c99 $(CFLAGS) $(INCS) -MM -MT "$(@:.d=.o) $@" $< -MF $@ + @$(CC) -std=c99 $(CFLAGS) $(DPDC_CFLAGS) -MM -MT "$(@:.d=.o) $@" $< -MF $@ .c.o: - $(CC) -std=c99 $(CFLAGS) $(INCS) -DS3D_SHARED_BUILD -c $< -o $@ + $(CC) -std=c99 $(CFLAGS) $(DPDC_CFLAGS) -DS3D_SHARED_BUILD -c $< -o $@ ################################################################################ # Installation @@ -157,8 +157,8 @@ TEST_SRC =\ TEST_OBJ = $(TEST_SRC:.c=.o) TEST_DEP = $(TEST_SRC:.c=.d) -S3D_CFLAGS = $$($(PKG_CONFIG) --with-path=./ $(PKG_FLAGS) --cflags s3d-local.pc) -S3D_LIBS = $$($(PKG_CONFIG) --with-path=./ $(PKG_FLAGS) --libs s3d-local.pc) +S3D_CFLAGS = $$($(PKG_CONFIG) --with-path=./ $(PCFLAGS) --cflags s3d-local.pc) +S3D_LIBS = $$($(PKG_CONFIG) --with-path=./ $(PCFLAGS) --libs s3d-local.pc) build_tests: build_library $(TEST_DEP) .test @$(MAKE) -fMakefile -f.test $$(for i in $(TEST_DEP); do echo -f"$${i}"; done) test_bin diff --git a/config.mk b/config.mk @@ -18,20 +18,20 @@ RANLIB = ranlib ################################################################################ # Dependencies ################################################################################ -PKG_FLAGS_SHARED = -PKG_FLAGS_STATIC = --static -PKG_FLAGS = $(PKG_FLAGS_$(LIB_TYPE)) +PCFLAGS_SHARED = +PCFLAGS_STATIC = --static +PCFLAGS = $(PCFLAGS_$(LIB_TYPE)) RSYS_VERSION=0.6 -RSYS_INC = $$($(PKG_CONFIG) $(PKG_FLAGS) --cflags rsys) -RSYS_LIB = $$($(PKG_CONFIG) $(PKG_FLAGS) --libs rsys) +RSYS_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags rsys) +RSYS_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs rsys) EMBREE_VERSION=4.0 -EMBREE_INC = $$($(PKG_CONFIG) $(PKG_FLAGS) --cflags embree4) -EMBREE_LIB = $$($(PKG_CONFIG) $(PKG_FLAGS) --libs embree4) +EMBREE_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags embree4) +EMBREE_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs embree4) -INCS=$(RSYS_INC) $(EMBREE_INC) -LIBS=$(RSYS_LIB) $(EMBREE_LIB) -lm +DPDC_CFLAGS=$(RSYS_CFLAGS) $(EMBREE_CFLAGS) +DPDC_LIBS=$(RSYS_LIBS) $(EMBREE_LIBS) -lm ################################################################################ # Compilation options