From ee87c6cc2e916f990160035934ca560147faa05c Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 14 Apr 2021 16:45:20 -0600 Subject: [PATCH] Make it easier to compile this from a script A few changes to make it easier to compile from a script overriding some of the symbols with environment variables and using `make -e` For example, I can now compile on linux using: ``` DYNLDFLAGS="-shared" CC=mpicc HDF5_DIR=/scratch/gdsjaar/seacas-async DYNEXT=so make -e ``` --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1aac98c..4479aef 100644 --- a/Makefile +++ b/Makefile @@ -10,15 +10,16 @@ INCLUDES=-I$(HDF5_DIR)/include CFLAGS = $(DEBUG) -fPIC $(INCLUDES) -Wall #LIBS=-L$(HDF5_DIR)/lib -L$(MPI_DIR)/lib -lhdf5 -lz LIBS=-L$(HDF5_DIR)/lib -lhdf5 -lz -DYNLDFLAGS = $(DEBUG) -dynamiclib -current_version 1.0 -fPIC $(LIBS) +DYNLDFLAGS = -dynamiclib -current_version 1.0 LDFLAGS = $(DEBUG) $(LIBS) ARFLAGS = rs # Shared library VOL connector +DYNEXT = dylib DYNSRC = H5VLprovnc.c DYNOBJ = $(DYNSRC:.c=.o) -DYNLIB = libh5prov.dylib -DYNDBG = libh5prov.dylib.dSYM +DYNLIB = libh5prov.$(DYNEXT) +DYNDBG = libh5prov.$(DYNEXT).dSYM # Testcase section EXSRC = vpicio_uni_h5.c @@ -32,7 +33,7 @@ $(EXEXE): $(EXSRC) $(STATLIB) $(DYNLIB) $(CC) $(CFLAGS) $^ -o $(EXEXE) $(LDFLAGS) $(DYNLIB): $(DYNSRC) - $(CC) $(CFLAGS) $(DYNLDFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $(DYNLDFLAGS) $(LIBS) $^ -o $@ .PHONY: clean all clean: