[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/multiarch f800e93 5/6: Refine directory structur
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/multiarch f800e93 5/6: Refine directory structure |
Date: |
Sun, 7 Apr 2019 10:48:33 -0400 (EDT) |
branch: odd/multiarch
commit f800e93dbff8a0be5434f3e7af5f776bc51b5eec
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Refine directory structure
---
GNUmakefile | 27 ++++++++++++++++++++++++---
install_miscellanea.make | 44 +++++++++++++++++++++++---------------------
workhorse.make | 2 +-
3 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index 1832e7f..0a3badc 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -121,8 +121,11 @@ srcdir := $(CURDIR)
localbindir := $(exec_prefix)/local/bin
locallibdir := $(exec_prefix)/local/lib
localincludedir := $(exec_prefix)/local/include
-test_dir := $(prefix)/test
-touchstone_dir := $(prefix)/touchstone
+# Presuppose that system-test results may legitimately vary by
+# architecture. If experience shows otherwise, then these should
+# become subdirectories of $(prefix) instead.
+test_dir := $(exec_prefix)/test
+touchstone_dir := $(exec_prefix)/touchstone
################################################################################
@@ -319,6 +322,24 @@ endef
# Almost all targets are built in a build directory, so the 'clean'
# target is run there: see 'workhorse.make'.
#
+# The 'clobber' target removes the build directories for every
+# $(build_type), but only for the current $LMI_HOST architecture,
+# i.e.:
+# $exec_prefix/build
+# and its subdirectories. A list of directories such as:
+# find $prefix -name build
+# would include some that this makefile does not build, as might even
+# such a list as:
+# find $prefix -maxdepth 2 -name build -type d
+# and it is not possible to enumerate all possible $LMI_HOST values.
+# This target could be made to remove all files built by this makefile
+# if the build directory were
+# build_directory := $(prefix)/build/$(LMI_HOST)/$(build_type)
+# instead of
+# build_directory := $(exec_prefix)/build/$(build_type)
+# but that would amount to inserting an infix into $exec_prefix,
+# which would be most odd.
+#
# This makefile has rules to build a few files in the source
# directory, viz.
# quoted_gpl
@@ -344,7 +365,7 @@ distclean mostlyclean maintainer-clean: clean
.PHONY: clobber
clobber: source_clean
- -$(RM) --force --recursive $(srcdir)/../build
+ -$(RM) --force --recursive $(exec_prefix)/build
################################################################################
diff --git a/install_miscellanea.make b/install_miscellanea.make
index 8d58fe1..a6ac86a 100644
--- a/install_miscellanea.make
+++ b/install_miscellanea.make
@@ -33,6 +33,8 @@ sf_mirror := https://downloads.sourceforge.net
# Nonconfigurable settings
#####################################################
+# 'z-' makes it alphabetize last:
+scratchdir := $(prefix)/third_party/zscratch
destination := $(prefix)/third_party
third_party_bin_dir := $(destination)/bin
@@ -110,7 +112,7 @@ destination_exists = \
"\n"
scratch_exists = \
- "\nError: Scratch directory 'scratch' already exists." \
+ "\nError: Scratch directory '$(scratchdir)' already exists." \
"\nProbably it is left over from a previous failure." \
"\nJust remove it unless you're sure you want whatever files" \
"\nit might contain." \
@@ -162,19 +164,19 @@ all: boost cgicc jing md5sum_msw sample trang xmlwrapp
.PHONY: boost
boost: $(file_list)
- -[ -e $(stem).patch ] && $(PATCH) --directory=scratch --strip=1 <
$(stem).patch
+ -[ -e $(stem).patch ] && $(PATCH) --directory=$(scratchdir) --strip=1 <
$(stem).patch
$(MKDIR) $(third_party_include_dir)/boost/
- $(CP) --force --preserve --recursive scratch/$(stem)/boost/*
$(third_party_include_dir)/boost/
+ $(CP) --force --preserve --recursive $(scratchdir)/$(stem)/boost/*
$(third_party_include_dir)/boost/
$(MKDIR) $(third_party_source_dir)/boost/
- $(MV) scratch/$(stem)/*
$(third_party_source_dir)/boost/
+ $(MV) $(scratchdir)/$(stem)/*
$(third_party_source_dir)/boost/
.PHONY: cgicc
cgicc: $(file_list)
- $(PATCH) --directory=scratch --strip=1 < $(stem).patch
+ $(PATCH) --directory=$(scratchdir) --strip=1 < $(stem).patch
$(MKDIR) $(third_party_include_dir)/cgicc
- $(MV) scratch/$(stem)/cgicc/*.h $(third_party_include_dir)/cgicc/
+ $(MV) $(scratchdir)/$(stem)/cgicc/*.h
$(third_party_include_dir)/cgicc/
$(MKDIR) $(third_party_source_dir)/cgicc
- $(MV) scratch/$(stem)/cgicc/*.cpp $(third_party_source_dir)/cgicc/
+ $(MV) $(scratchdir)/$(stem)/cgicc/*.cpp $(third_party_source_dir)/cgicc/
cd $(destination) && $(MD5SUM) --binary include/cgicc/* src/cgicc/*
>$(stem).md5sums
cd $(destination) && $(MD5SUM) --check $(CURDIR)/$(stem).md5sums
$(SORT) --key=2 --output=$(stem).X $(stem).md5sums
@@ -184,8 +186,8 @@ cgicc: $(file_list)
.PHONY: jing
jing: $(file_list)
$(MKDIR) --parents $(destination)/rng
- $(MV) scratch/$(stem)/bin/address@hidden $(destination)/rng
- $(MV) scratch/$(stem)/bin/xercesImpl.jar $(destination)/rng
+ $(MV) $(scratchdir)/$(stem)/bin/address@hidden
$(destination)/rng
+ $(MV) $(scratchdir)/$(stem)/bin/xercesImpl.jar $(destination)/rng
# The 'md5sum_msw' binary is redistributed to msw end users for
# authentication, so the 'fardel' target requires it. On other
@@ -210,24 +212,24 @@ md5sum_msw: $(file_list)
.PHONY: sample
sample: $(file_list)
-$(MKDIR) --parents $(prefix)/data
- $(MV) scratch/$(stem)/* $(prefix)/data
+ $(MV) $(scratchdir)/$(stem)/* $(prefix)/data
.PHONY: trang
trang: $(file_list)
$(MKDIR) --parents $(destination)/rng
- $(MV) scratch/$(stem)/address@hidden $(destination)/rng
+ $(MV) $(scratchdir)/$(stem)/address@hidden $(destination)/rng
.PHONY: xmlwrapp
xmlwrapp: $(file_list)
- -[ -e $(stem).patch ] && $(PATCH) --directory=scratch --strip=1 <
$(stem).patch
+ -[ -e $(stem).patch ] && $(PATCH) --directory=$(scratchdir) --strip=1 <
$(stem).patch
$(MKDIR) $(third_party_include_dir)/xmlwrapp/
- $(MV) scratch/$(stem)/include/xmlwrapp/*.h
$(third_party_include_dir)/xmlwrapp/
+ $(MV) $(scratchdir)/$(stem)/include/xmlwrapp/*.h
$(third_party_include_dir)/xmlwrapp/
$(MKDIR) $(third_party_include_dir)/xsltwrapp/
- $(MV) scratch/$(stem)/include/xsltwrapp/*.h
$(third_party_include_dir)/xsltwrapp/
+ $(MV) $(scratchdir)/$(stem)/include/xsltwrapp/*.h
$(third_party_include_dir)/xsltwrapp/
$(MKDIR) $(third_party_source_dir)/libxml/
- $(MV) scratch/$(stem)/src/libxml/* $(third_party_source_dir)/libxml/
+ $(MV) $(scratchdir)/$(stem)/src/libxml/*
$(third_party_source_dir)/libxml/
$(MKDIR) $(third_party_source_dir)/libxslt/
- $(MV) scratch/$(stem)/src/libxslt/* $(third_party_source_dir)/libxslt/
+ $(MV) $(scratchdir)/$(stem)/src/libxslt/*
$(third_party_source_dir)/libxslt/
cd $(destination) && $(MD5SUM) --binary include/xmlwrapp/*
include/xsltwrapp/* src/libxml/* src/libxslt/* >$(stem).md5sums
cd $(destination) && $(MD5SUM) --check $(CURDIR)/$(stem).md5sums
$(SORT) --key=2 --output=$(stem).X $(stem).md5sums
@@ -239,14 +241,14 @@ $(file_list): initial_setup
.PHONY: initial_setup
initial_setup:
@[ ! -e $(destination) ] || { printf '%b' $(destination_exists) &&
false; }
- @[ ! -e scratch ] || { printf '%b' $(scratch_exists) &&
false; }
+ @[ ! -e $(scratchdir) ] || { printf '%b' $(scratch_exists) &&
false; }
$(MKDIR) --parents $(cache_dir)
$(MKDIR) --parents $(destination)
+ $(MKDIR) --parents $(scratchdir)
$(MKDIR) $(third_party_bin_dir)
$(MKDIR) $(third_party_include_dir)
$(MKDIR) $(third_party_lib_dir)
$(MKDIR) $(third_party_source_dir)
- $(MKDIR) scratch
TARFLAGS := --keep-old-files
%.tar.bz2: TARFLAGS += --bzip2
@@ -260,7 +262,7 @@ WGETFLAGS := --no-check-certificate
%.tar.bz2 %.tar.gz:
cd $(cache_dir) && [ -e $@ ] || $(WGET) $(WGETFLAGS) $(address@hidden)
$(ECHO) "$(address@hidden) *$(cache_dir)/$@" | $(MD5SUM) --check
- -$(TAR) --extract $(TARFLAGS) --directory=scratch --file=$(cache_dir)/$@
+ -$(TAR) --extract $(TARFLAGS) --directory=$(scratchdir)
--file=$(cache_dir)/$@
.PHONY: %.exe
%.exe:
@@ -272,7 +274,7 @@ WGETFLAGS := --no-check-certificate
%.zip:
cd $(cache_dir) && [ -e $@ ] || $(WGET) $(WGETFLAGS) $(address@hidden)
$(ECHO) "$(address@hidden) *$(cache_dir)/$@" | $(MD5SUM) --check
- -$(UNZIP) $(UNZIPFLAGS) $(cache_dir)/$@ -d scratch
+ -$(UNZIP) $(UNZIPFLAGS) $(cache_dir)/$@ -d $(scratchdir)
# Maintenance
##################################################################
@@ -280,5 +282,5 @@ WGETFLAGS := --no-check-certificate
.PHONY: clobber
clobber:
- $(RM) --force --recursive scratch
+ $(RM) --force --recursive $(scratchdir)
$(RM) --force --recursive $(destination)
diff --git a/workhorse.make b/workhorse.make
index d5ee253..6deb59a 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -1120,7 +1120,7 @@ archive_shared_data_files:
# - extra_fardel_checksummed_files
fardel_name := lmi-$(yyyymmddhhmm)
-fardel_dir := $(prefix)/$(fardel_name)
+fardel_dir := $(prefix)/fardels/$(fardel_name)
# The obvious y2038 problem is ignored because any breakage it causes
# will be, well, obvious.
- [lmi-commits] [lmi] odd/multiarch updated (e06e543 -> 3e4dbdf), Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch 3cad4c9 3/6: Write 'export var="value"' on a single line, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch 81bb4e6 2/6: Assume makefiles use a POSIX-compatible shell, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch 3551a75 1/6: Make $(build_directory) an immediately-expanded variable again, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch b94771d 4/6: Distinguish build from host architecture, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch 3e4dbdf 6/6: Change a makefile variable's name to improve concinnity, Greg Chicares, 2019/04/07
- [lmi-commits] [lmi] odd/multiarch f800e93 5/6: Refine directory structure,
Greg Chicares <=