From fb779d2f1e26a280f381886f3cdf444102676249 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 19 Nov 2017 13:49:26 -0500 Subject: Rework directory structure to use GNU-recommended "src" directory. Move the source code (other than glob) into the "src" subdirectory. Update all scripting and recommendations to support this change. * *.c, *.h, w32/*: Move to src/ * configure.ac, Makefile.am, maintMakefile: Locate new source files. * Basic.mk.template, mk/*: Update for new source file locations. * NEWS, README.DOS.template: Update for new locations. * build.template, build_w32.bat, builddos.bat: Ditto. * po/POTFILES.in: Ditto * tests/run_make_tests.pl, tests/scripts/features/load*: Ditto. * make.1: Move to doc. * mk/VMS.mk: Add support for building on VMS (hopefully). * makefile.vms, prepare_w32.bat: Remove. * SCOPTIONS: Update to define HAVE_CONFIG_H --- Basic.mk.template | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'Basic.mk.template') diff --git a/Basic.mk.template b/Basic.mk.template index ab45f87f..64cd9c3a 100644 --- a/Basic.mk.template +++ b/Basic.mk.template @@ -28,20 +28,40 @@ all: -make_SOURCES = %make_SOURCES% remote-stub.c +src = src/ +glob = glob/ + +make_SOURCES = %make_SOURCES% glob_SOURCES = %glob_SOURCES% +loadavg_SOURCES = %loadavg_SOURCES% +alloca_SOURCES = %alloca_SOURCES% w32_SOURCES = %w32_SOURCES% vms_SOURCES = %vms_SOURCES% amiga_SOURCES = %amiga_SOURCES% -OUTDIR = . +posix_SOURCES = $(src)posixos.c +remote_SOURCES = $(src)remote-stub.c + +OUTDIR = SRCDIR = . OBJEXT = o EXEEXT = -PROG = $(OUTDIR)/make$(EXEEXT) +PREFIX = /usr/local +INCLUDEDIR = $(PREFIX)/include +LIBDIR = $(PREFIX)/lib +LOCALEDIR = $(PREFIX)/share + +PROG = $(OUTDIR)make$(EXEEXT) + +prog_SOURCES = $(make_SOURCES) $(remote_SOURCES) + +OBJECTS = $(patsubst %.c,$(OUTDIR)%.$(OBJEXT),$(prog_SOURCES)) +OBJDIRS = $(addsuffix .,$(sort $(dir $(OBJECTS)))) + +# Use the default value of CC LD = $(CC) # Reserved for command-line override @@ -49,9 +69,8 @@ CPPFLAGS = CFLAGS = -g -O2 LDFLAGS = -prog_SOURCES = $(make_SOURCES) - -extra_CPPFLAGS = -DHAVE_CONFIG_H -I$(OUTDIR) -I$(SRCDIR) +extra_CPPFLAGS = -DHAVE_CONFIG_H -I$(OUTDIR)src -I$(SRCDIR)/src \ + -DLIBDIR=\"$(LIBDIR)\" -DINCLUDEDIR=\"$(INCLUDEDIR)\" -DLOCALEDIR=\"$(LOCALDIR)\" extra_CFLAGS = extra_LDFLAGS = $(extra_CFLAGS) $(CFLAGS) @@ -65,7 +84,10 @@ COMPILE.cmd = $(CC) $(extra_CFLAGS) $(CFLAGS) $(extra_CPPFLAGS) $(CPPFLAGS) $(TA LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) $(LINK_OUTPUT) -CHECK.cmd = cd tests && ./run_make_tests -make $(shell cd $(