Commit 84b360a7 authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Make DESTDIR operation match common practice

Modify DESTDIR to match common practice (for instance, that of automake),
in that DESTDIR represents a staged install directory. It is intended
that the tree would need to than be copied to the final install location
afterwards. When supplied, DESTDIR will not change any compiled-in
paths in darshan.

See the automake manual section about DESTDIR for an example of standard
usage.

https://www.gnu.org/software/automake/manual/html_node/DESTDIR.html
parent 68b06d4a
#TODO: each module provides own makefile with module-specific objects, build options, etc.
DESTDIR =
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = $(DESTDIR)@datarootdir@
includedir = $(DESTDIR)@includedir@
mandir = $(DESTDIR)@mandir@
sbindir = $(DESTDIR)@sbindir@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@
datarootdir = @datarootdir@
includedir = @includedir@
mandir = @mandir@
sbindir = @sbindir@
bindir = @bindir@
libdir = @libdir@
LDFLAGS = @LDFLAGS@
CC = @CC@
LD = @LD@
......@@ -221,56 +220,56 @@ endif
install:: all
install -d $(libdir)
install -d $(DESTDIR)$(libdir)
ifndef DISABLE_STATIC_LIB
install -m 755 lib/libdarshan.a $(libdir)
install -m 755 lib/libdarshan-stubs.a $(libdir)
install -m 755 lib/libdarshan.a $(DESTDIR)$(libdir)
install -m 755 lib/libdarshan-stubs.a $(DESTDIR)$(libdir)
endif
ifndef DISABLE_LDPRELOAD
install -m 755 lib/libdarshan.so $(libdir)
install -m 755 lib/libdarshan.so $(DESTDIR)$(libdir)
endif
install -d $(bindir)
install -m 755 darshan-mk-log-dirs.pl $(bindir)
install -m 755 darshan-gen-cc.pl $(bindir)
install -m 755 darshan-gen-cxx.pl $(bindir)
install -m 755 darshan-gen-fortran.pl $(bindir)
install -m 755 darshan-config $(bindir)
install -d $(datarootdir)/craype-1.x/modulefiles/darshan
install -m 755 share/craype-1.x/darshan-module $(datarootdir)/craype-1.x/modulefiles/darshan/$(DARSHAN_VERSION)
install -d $(datarootdir)/craype-2.x/modulefiles/darshan
install -m 755 share/craype-2.x/darshan-module $(datarootdir)/craype-2.x/modulefiles/darshan/$(DARSHAN_VERSION)
install -d $(datarootdir)/mpi-profile
install -m 755 share/mpi-profile/darshan-cc.conf $(datarootdir)/mpi-profile/darshan-cc.conf
install -m 755 share/mpi-profile/darshan-cxx.conf $(datarootdir)/mpi-profile/darshan-cxx.conf
install -m 755 share/mpi-profile/darshan-f.conf $(datarootdir)/mpi-profile/darshan-f.conf
install -m 755 share/mpi-profile/darshan-bg-cc.conf $(datarootdir)/mpi-profile/darshan-bg-cc.conf
install -m 755 share/mpi-profile/darshan-bg-cxx.conf $(datarootdir)/mpi-profile/darshan-bg-cxx.conf
install -m 755 share/mpi-profile/darshan-bg-f.conf $(datarootdir)/mpi-profile/darshan-bg-f.conf
install -d $(datarootdir)/ld-opts
install -m 644 share/ld-opts/darshan-base-ld-opts $(datarootdir)/ld-opts/darshan-base-ld-opts
install -d $(DESTDIR)$(bindir)
install -m 755 darshan-mk-log-dirs.pl $(DESTDIR)$(bindir)
install -m 755 darshan-gen-cc.pl $(DESTDIR)$(bindir)
install -m 755 darshan-gen-cxx.pl $(DESTDIR)$(bindir)
install -m 755 darshan-gen-fortran.pl $(DESTDIR)$(bindir)
install -m 755 darshan-config $(DESTDIR)$(bindir)
install -d $(DESTDIR)$(datarootdir)/craype-1.x/modulefiles/darshan
install -m 755 share/craype-1.x/darshan-module $(DESTDIR)$(datarootdir)/craype-1.x/modulefiles/darshan/$(DARSHAN_VERSION)
install -d $(DESTDIR)$(datarootdir)/craype-2.x/modulefiles/darshan
install -m 755 share/craype-2.x/darshan-module $(DESTDIR)$(datarootdir)/craype-2.x/modulefiles/darshan/$(DARSHAN_VERSION)
install -d $(DESTDIR)$(datarootdir)/mpi-profile
install -m 755 share/mpi-profile/darshan-cc.conf $(DESTDIR)$(datarootdir)/mpi-profile/darshan-cc.conf
install -m 755 share/mpi-profile/darshan-cxx.conf $(DESTDIR)$(datarootdir)/mpi-profile/darshan-cxx.conf
install -m 755 share/mpi-profile/darshan-f.conf $(DESTDIR)$(datarootdir)/mpi-profile/darshan-f.conf
install -m 755 share/mpi-profile/darshan-bg-cc.conf $(DESTDIR)$(datarootdir)/mpi-profile/darshan-bg-cc.conf
install -m 755 share/mpi-profile/darshan-bg-cxx.conf $(DESTDIR)$(datarootdir)/mpi-profile/darshan-bg-cxx.conf
install -m 755 share/mpi-profile/darshan-bg-f.conf $(DESTDIR)$(datarootdir)/mpi-profile/darshan-bg-f.conf
install -d $(DESTDIR)$(datarootdir)/ld-opts
install -m 644 share/ld-opts/darshan-base-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-base-ld-opts
ifdef BUILD_POSIX_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-posix-ld-opts $(datarootdir)/ld-opts/darshan-posix-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-posix-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-posix-ld-opts
endif
ifdef BUILD_STDIO_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-stdio-ld-opts $(datarootdir)/ld-opts/darshan-stdio-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-stdio-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-stdio-ld-opts
endif
ifdef BUILD_MPIIO_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-mpiio-ld-opts $(datarootdir)/ld-opts/darshan-mpiio-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-mpiio-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-mpiio-ld-opts
endif
ifdef BUILD_PNETCDF_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts
endif
ifdef BUILD_HDF5_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-hdf5-ld-opts $(datarootdir)/ld-opts/darshan-hdf5-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-hdf5-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-hdf5-ld-opts
endif
ifdef BUILD_MDHIM_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-mdhim-ld-opts $(datarootdir)/ld-opts/darshan-mdhim-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-mdhim-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-mdhim-ld-opts
endif
ifdef ENABLE_MMAP_LOGS
install -m 755 share/darshan-mmap-epilog.sh $(datarootdir)/darshan-mmap-epilog.sh
install -m 755 share/darshan-mmap-epilog.sh $(DESTDIR)$(datarootdir)/darshan-mmap-epilog.sh
endif
install -d $(libdir)/pkgconfig
install -m 644 lib/pkgconfig/darshan-runtime.pc $(libdir)/pkgconfig/darshan-runtime.pc
install -d $(DESTDIR)$(libdir)/pkgconfig
install -m 644 lib/pkgconfig/darshan-runtime.pc $(DESTDIR)$(libdir)/pkgconfig/darshan-runtime.pc
clean::
rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so
......
all: libdarshan-util.a darshan-null-logutils.o darshan-analyzer darshan-convert darshan-diff darshan-parser darshan-dxt-parser darshan-merge jenkins-hash-gen
DESTDIR =
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = $(DESTDIR)@datarootdir@
includedir = $(DESTDIR)@includedir@
mandir = $(DESTDIR)@mandir@
sbindir = $(DESTDIR)@sbindir@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@
datarootdir = @datarootdir@
includedir = @includedir@
mandir = @mandir@
sbindir = @sbindir@
bindir = @bindir@
libdir = @libdir@
DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
DARSHAN_MOD_LOG_FORMATS = $(srcdir)/../darshan-posix-log-format.h \
......@@ -173,56 +172,56 @@ darshan-merge: darshan-merge.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHA
# $(CC) $(CFLAGS) $(LDFLAGS) -lz $< -o $@
install:: all
install -d $(bindir)
install -d $(libdir)
install -d $(includedir)
install -m 755 darshan-analyzer $(bindir)
install -m 755 darshan-convert $(bindir)
install -m 755 darshan-diff $(bindir)
install -m 755 darshan-parser $(bindir)
install -m 755 darshan-dxt-parser $(bindir)
install -m 755 darshan-merge $(bindir)
install -m 755 $(srcdir)/darshan-summary-per-file.sh $(bindir)
install -m 755 $(srcdir)/dxt_analyzer.py $(bindir)
install -m 755 libdarshan-util.a $(libdir)
install -d $(DESTDIR)$(bindir)
install -d $(DESTDIR)$(libdir)
install -d $(DESTDIR)$(includedir)
install -m 755 darshan-analyzer $(DESTDIR)$(bindir)
install -m 755 darshan-convert $(DESTDIR)$(bindir)
install -m 755 darshan-diff $(DESTDIR)$(bindir)
install -m 755 darshan-parser $(DESTDIR)$(bindir)
install -m 755 darshan-dxt-parser $(DESTDIR)$(bindir)
install -m 755 darshan-merge $(DESTDIR)$(bindir)
install -m 755 $(srcdir)/darshan-summary-per-file.sh $(DESTDIR)$(bindir)
install -m 755 $(srcdir)/dxt_analyzer.py $(DESTDIR)$(bindir)
install -m 755 libdarshan-util.a $(DESTDIR)$(libdir)
ifeq ($(DARSHAN_ENABLE_SHARED),1)
install -m 755 libdarshan-util.so $(libdir)
install -m 755 libdarshan-util.so $(DESTDIR)$(libdir)
endif
install -m 644 $(srcdir)/darshan-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-posix-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-mpiio-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-hdf5-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-pnetcdf-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-bgq-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-null-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-lustre-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-stdio-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-dxt-logutils.h $(includedir)
install -m 644 $(srcdir)/darshan-mdhim-logutils.h $(includedir)
install -m 644 $(srcdir)/../darshan-null-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-posix-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-mpiio-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-hdf5-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-pnetcdf-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-bgq-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-lustre-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-stdio-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-dxt-log-format.h $(includedir)
install -m 644 $(srcdir)/../darshan-mdhim-log-format.h $(includedir)
install -d $(includedir)/uthash-1.9.2
install -d $(includedir)/uthash-1.9.2/src
install -m 644 uthash-1.9.2/src/uthash.h $(includedir)/uthash-1.9.2/src/
install -m 644 $(DARSHAN_LOG_FORMAT) $(includedir)
install -m 755 darshan-job-summary/bin/darshan-job-summary.pl $(bindir)
install -d $(libdir)/TeX
install -m 644 $(srcdir)/darshan-job-summary/lib/TeX/Encode.pm $(libdir)/TeX/
install -d $(libdir)/Number
install -d $(libdir)/Number/Bytes
install -m 644 $(srcdir)/darshan-job-summary/lib/Number/Bytes/Human.pm $(libdir)/Number/Bytes
install -d $(datarootdir)
install -m 644 $(srcdir)/darshan-job-summary/share/* $(datarootdir)
install -d $(libdir)/pkgconfig
install -m 644 maint/darshan-util.pc $(libdir)/pkgconfig/darshan-util.pc
install -m 644 $(srcdir)/darshan-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-posix-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-mpiio-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-hdf5-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-pnetcdf-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-bgq-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-null-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-lustre-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-stdio-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-dxt-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/darshan-mdhim-logutils.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-null-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-posix-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-mpiio-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-hdf5-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-pnetcdf-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-bgq-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-lustre-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-stdio-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-dxt-log-format.h $(DESTDIR)$(includedir)
install -m 644 $(srcdir)/../darshan-mdhim-log-format.h $(DESTDIR)$(includedir)
install -d $(DESTDIR)$(includedir)/uthash-1.9.2
install -d $(DESTDIR)$(includedir)/uthash-1.9.2/src
install -m 644 uthash-1.9.2/src/uthash.h $(DESTDIR)$(includedir)/uthash-1.9.2/src/
install -m 644 $(DARSHAN_LOG_FORMAT) $(DESTDIR)$(includedir)
install -m 755 darshan-job-summary/bin/darshan-job-summary.pl $(DESTDIR)$(bindir)
install -d $(DESTDIR)$(libdir)/TeX
install -m 644 $(srcdir)/darshan-job-summary/lib/TeX/Encode.pm $(DESTDIR)$(libdir)/TeX/
install -d $(DESTDIR)$(libdir)/Number
install -d $(DESTDIR)$(libdir)/Number/Bytes
install -m 644 $(srcdir)/darshan-job-summary/lib/Number/Bytes/Human.pm $(DESTDIR)$(libdir)/Number/Bytes
install -d $(DESTDIR)$(datarootdir)
install -m 644 $(srcdir)/darshan-job-summary/share/* $(DESTDIR)$(datarootdir)
install -d $(DESTDIR)$(libdir)/pkgconfig
install -m 644 maint/darshan-util.pc $(DESTDIR)$(libdir)/pkgconfig/darshan-util.pc
clean::
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment