summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2017-11-12 17:44:38 -0500
committerPaul Smith <psmith@gnu.org>2017-11-18 09:31:31 -0500
commitaa44e66c8f31370a7d785259affb4eb32f341764 (patch)
tree122bcde858547c53adf03adbfcebae41c306e090 /mk
parenta7e0dd98e430c3fb7f66b8cc30a1868353d214bd (diff)
downloadmake-git-aa44e66c8f31370a7d785259affb4eb32f341764.tar.gz
Remove unsupported build facilities.
Over time the non-standard build and install systems (nmake files, smake files, Visual Studio project files, etc.) have atrophied and maintaining them is not worth the effort, for such a simple utility as make. Remove all the non-standard build tool support and unify OS-specific build rules under a basic set of (GNU make) makefiles. Preserve the existing bootstrapping scripts (for POSIX, Windows, and MS-DOS). Also the existing VMS build scripts are left unchanged: I don't have enough experience with VMS to venture into this area. Perhaps one of the VMS maintainers might like to determine whether conversion would be appropriate. Rather than create libraries for w32 and glob (non-POSIX), simply link the object files directly to remove the complexity. * NEWS: Update with user-facing notes. * Makefile.am: Clean up to use the latest automake best practices. Build Windows code directly from the root makefile to avoid recursion. * README.Amiga, README.DOS.template, README.W32.template: Updated. * INSTALL: Point readers at the README.git file. * maintMakefile: Remove obsolete files. Create Basic.mk file. * Basic.mk.template, mk/*.mk: Create basic GNU make-based makefiles. * build_w32.bat: Copy Basic.mk to Makefile * configure.ac: We no longer need AM_PROG_AR. * dosbuild.bat: Rename to builddos.bat. Incorporate configure.bat. * Makefile.DOS.template: Remove. * NMakefile.template, w32/subproc/NMakefile: Remove. * SMakefile.template, glob/SMakefile, glob/SCOPTIONS, make.lnk: Remove. * configure.bat, glob/configure.bat: Remove. * w32/Makefile.am: Remove. * make_msvc_net2003.sln, make_msvc_net2003.vcproj: Remove.
Diffstat (limited to 'mk')
-rw-r--r--mk/Amiga.mk41
-rw-r--r--mk/Windows32.mk116
-rw-r--r--mk/msdosdjgpp.mk34
3 files changed, 191 insertions, 0 deletions
diff --git a/mk/Amiga.mk b/mk/Amiga.mk
new file mode 100644
index 00000000..fe2a1f64
--- /dev/null
+++ b/mk/Amiga.mk
@@ -0,0 +1,41 @@
+# GNU -*-Makefile-*- to build GNU make on Amiga
+#
+# Amiga overrides for use with Basic.mk.
+#
+# Copyright (C) 2017 Free Software Foundation, Inc.
+# This file is part of GNU Make.
+#
+# GNU Make is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+CC = sc
+LD = $(CC) Link
+RM = delete
+MKDIR = makedir
+
+CPPFLAGS =
+CFLAGS =
+LDFLAGS =
+
+prog_SOURCES += alloca.c getloadavg.c $(glob_SOURCES) $(amiga_SOURCES)
+
+extra_CPPFLAGS = IDir "" IDir $(SRCDIR)/glob
+
+C_SOURCE =
+OUTPUT_OPTION =
+LDFLAGS = From LIB:cres.o
+LDLIBS = Lib LIB:sc.lib LIB:amiga.lib
+LINK_OUTPUT = To $@
+
+$(OUTDIR)/config.h: $(SRCDIR)/config.ami
+ copy $< To $@
diff --git a/mk/Windows32.mk b/mk/Windows32.mk
new file mode 100644
index 00000000..8848827b
--- /dev/null
+++ b/mk/Windows32.mk
@@ -0,0 +1,116 @@
+# GNU -*-Makefile-*- to build GNU make on Windows
+#
+# Windows overrides for use with Makebase.mk.
+#
+# Copyright (C) 2017 Free Software Foundation, Inc.
+# This file is part of GNU Make.
+#
+# GNU Make is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+# TARGET_TYPE can be either "release" or "debug"
+TARGET_TYPE = release
+
+# TOOLCHAIN can be either "msvc" or "gcc"
+TOOLCHAIN = msvc
+
+
+prog_SOURCES += getloadavg.c $(glob_SOURCES) $(w32_SOURCES)
+
+w32_LIBS = kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 \
+ oleaut32 uuid odbc32 odbccp32
+
+CPPFLAGS =
+CFLAGS =
+LDFLAGS =
+
+# --- Visual Studio
+msvc_CC = cl.exe
+msvc_LD = link.exe
+
+msvc_CPPFLAGS = /DHAVE_CONFIG_H /DWINDOWS32 /DWIN32 /D_CONSOLE
+msvc_CPPFLAGS += /I$(OUTDIR) /I$(SRCDIR) /I$(SRCDIR)/glob /I$(SRCDIR)/w32/include
+
+msvc_CFLAGS = /nologo /MT /W4 /EHsc
+msvc_CFLAGS += /FR$(OUTDIR) /Fp$(BASE_PROG).pch /Fd$(BASE_PROG).pdb
+
+msvc_LDFLAGS = /nologo /SUBSYSTEM:console /PDB:$(BASE_PROG).pdb
+
+msvc_LDLIBS = $(addsuffix .lib,$(w32_LIBS))
+
+msvc_C_SOURCE = /c
+msvc_OUTPUT_OPTION = /Fo$@
+msvc_LINK_OUTPUT = /OUT:$@
+
+release_msvc_OUTDIR = ./WinRel
+release_msvc_CPPFLAGS = /D NDEBUG
+release_msvc_CFLAGS = /O2
+
+debug_msvc_OUTDIR = ./WinDebug
+debug_msvc_CPPFLAGS = /D _DEBUG
+debug_msvc_CFLAGS = /Zi /Od
+debug_msvc_LDFLAGS = /DEBUG
+
+# --- GCC
+gcc_CC = gcc
+gcc_LD = $(gcc_CC)
+
+release_gcc_OUTDIR = ./GccRel
+debug_gcc_OUTDIR = ./GccDebug
+
+gcc_CPPFLAGS = -DHAVE_CONFIG_H -I$(OBJDIR) -I$(SRCDIR) -I$(SRCDIR)/glob -I$(SRCDIR)/w32/include
+gcc_CFLAGS = -mthreads -Wall -std=gnu99 -gdwarf-2 -g3
+gcc_LDFLAGS = -mthreads -gdwarf-2 -g3
+gcc_LDLIBS = $(addprefix -l,$(w32_libs))
+
+gcc_C_SOURCE = -c
+gcc_OUTPUT_OPTION = -o $@
+gcc_LINK_OUTPUT = -o $@
+
+debug_gcc_CFLAGS = -O0
+release_gcc_CFLAGS = -O2
+
+# ---
+
+LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) $(LINK_OUTPUT)
+
+CHECK.cmd = cmd /c cd tests \& .\run_make_tests.bat -make ../$(PROG)
+
+MKDIR.cmd = cmd /c mkdir $(subst /,\\,$@)
+RM.cmd = cmd /c del /F /Q $(subst /,\\,$(OBJECTS) $(PROG))
+
+CC = $($(TOOLCHAIN)_CC)
+LD = $($(TOOLCHAIN)_LD)
+
+C_SOURCE = $($(TOOLCHAIN)_C_SOURCE)
+OUTPUT_OPTION = $($(TOOLCHAIN)_OUTPUT_OPTION)
+LINK_OUTPUT = $($(TOOLCHAIN)_LINK_OUTPUT)
+
+OUTDIR = $($(TARGET_TYPE)_$(TOOLCHAIN)_OUTDIR)
+
+OBJEXT = obj
+EXEEXT = .exe
+
+_CUSTOM = $($(TOOLCHAIN)_$1) $($(TARGET_TYPE)_$1) $($(TARGET_TYPE)_$(TOOLCHAIN)_$1)
+
+# I'm not sure why this builds gnumake rather than make...?
+PROG = $(OUTDIR)/gnumake$(EXEEXT)
+BASE_PROG = $(basename $(PROG))
+
+extra_CPPFLAGS = $(call _CUSTOM,CPPFLAGS)
+extra_CFLAGS = $(call _CUSTOM,CFLAGS)
+extra_LDFLAGS = $(call _CUSTOM,LDFLAGS)
+LDLIBS = $(call _CUSTOM,LDLIBS)
+
+$(OUTDIR)/config.h: $(SRCDIR)/config.h.W32
+ cmd /c copy /Y $(subst /,\\,$< $@)
diff --git a/mk/msdosdjgpp.mk b/mk/msdosdjgpp.mk
new file mode 100644
index 00000000..a9dd2501
--- /dev/null
+++ b/mk/msdosdjgpp.mk
@@ -0,0 +1,34 @@
+# GNU -*-Makefile-*- to build GNU make on MS-DOS with DJGPP
+#
+# MS-DOS overrides for use with Makebase.mk.
+#
+# Copyright (C) 2017 Free Software Foundation, Inc.
+# This file is part of GNU Make.
+#
+# GNU Make is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+OBJEXT = o
+EXEEXT = .exe
+
+CC = gcc
+
+prog_SOURCES += getloadavg.c $(glob_SOURCES)
+
+extra_CPPFLAGS += -I$(SRCDIR)/glob -DINCLUDEDIR=\"c:/djgpp/include\" -DLIBDIR=\"c:/djgpp/lib\"
+
+MKDIR.cmd = command.com /c mkdir $(subst /,\\,$@)
+RM.cmd = command.com /c del /F /Q $(subst /,\\,$(OBJECTS) $(PROG))
+
+$(OUTDIR)/config.h: $(SRCDIR)/configh.dos
+ command.com /c copy /Y $(subst /,\\,$< $@)