From 3024da579f6bca7d66a9df5f73fe662e888a5f4e Mon Sep 17 00:00:00 2001 From: waltje Date: Thu, 28 Sep 2023 20:22:02 -0400 Subject: [PATCH] Updated makefiles. --- src/plat/mac/Makefile.mac | 16 +++++++-------- src/plat/unix/Makefile.GCC | 41 ++++++++++--------------------------- src/plat/unix/Makefile.TCC | 36 +++++++------------------------- src/plat/win/Makefile.MSVC | 9 +++----- src/plat/win/Makefile.MinGW | 13 ++++++------ src/plat/win/Makefile.TCC | 18 +++++----------- 6 files changed, 40 insertions(+), 93 deletions(-) diff --git a/src/plat/mac/Makefile.mac b/src/plat/mac/Makefile.mac index b6f9c13..3c9e6ca 100644 --- a/src/plat/mac/Makefile.mac +++ b/src/plat/mac/Makefile.mac @@ -8,7 +8,7 @@ # # Makefile for macOS systems using the Xcode environment. # -# Version: @(#)Makefile.mac 1.2.0 2023/08/20 +# Version: @(#)Makefile.mac 1.2.1 2023/09/28 # # Author: Fred N. van Kempen, # @@ -48,13 +48,13 @@ ifndef ARCH ARCH := x64 endif - ifndef DEBUG DEBUG := n endif -DEFS := -DALLOW_UNDEFINED_IF +# General options. +DEFS := -DALLOW_UNDEFINED_IF ifndef MOS6502 @@ -180,7 +180,6 @@ else endif endif endif -OPTS += ifeq ($(PROFILER), y) LOPTS += -Xlinker -Map=$(PROG).map endif @@ -189,8 +188,9 @@ endif # Final versions of the toolchain flags. CFLAGS = $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ $(AFLAGS) $(INCS) $(DEFS) \ - -mstackrealign -fno-strict-aliasing \ - -Wall -Wundef #-Wmissing-declarations + -mstackrealign \ + -fno-strict-aliasing \ + -Wall -Wundef LDFLAGS := $(LOPTS) $(DFLAGS) $(LDIR) ARFLAGS := $(AOPTS) @@ -217,7 +217,7 @@ endif # Nothing should need changing from here on.. # ######################################################################### -# Final fixups. +INCS += -Iplat/mac VPATH := plat/mac . targets #LIBS := @@ -264,7 +264,7 @@ depclean: depends: DEPOBJ=$(OBJ:%.o=%.d) depends: depclean $(DEPOBJ) @$(CAT) $(DEPOBJ) >>$(DEPFILE) - @-del $(DEPOBJ) + @-rm -f $(DEPOBJ) $(DEPFILE): diff --git a/src/plat/unix/Makefile.GCC b/src/plat/unix/Makefile.GCC index 7d2ae17..58b0d9f 100644 --- a/src/plat/unix/Makefile.GCC +++ b/src/plat/unix/Makefile.GCC @@ -8,7 +8,7 @@ # # Makefile for UNIX-like systems using the GCC environment. # -# Version: @(#)Makefile.GCC 1.2.0 2023/08/20 +# Version: @(#)Makefile.GCC 1.2.1 2023/09/28 # # Author: Fred N. van Kempen, # @@ -48,13 +48,13 @@ ifndef ARCH ARCH := x86 endif - ifndef DEBUG DEBUG := n endif -DEFS := -DALLOW_UNDEFINED_IF +# General options. +DEFS := -DALLOW_UNDEFINED_IF ifndef MOS6502 @@ -126,18 +126,6 @@ endif # Nothing should need changing from here on.. # ######################################################################### -# Import the various platform/architecture names. -ifdef MAKEFILE_LIST -#TOPDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) - TOPDIR := /project/VARCem/src/build - TOPFILE := $(abspath $(firstword $(MAKEFILE_LIST))) -else - TOPDIR := ./build - TOPFILE := Makefile.GCC -endif -include $(TOPDIR)/OSDetect.mk -include $(TOPDIR)/archs.mk - # Definitions for this enivonment. DEVENV := gcc DEPS = -MMD -MF $*.d @@ -217,20 +205,17 @@ else endif endif endif -OPTS += ifeq ($(PROFILER), y) LOPTS += -Xlinker -Map=$(PROG).map endif -# Final fixups. -INCS += -Iplat/unix - # Final versions of the toolchain flags. -CFLAGS = $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ - $(AFLAGS) $(INCS) $(DEFS) -mstackrealign \ - -fomit-frame-pointer -fno-strict-aliasing \ - -Wall -Wundef #-Wmissing-declarations +CFLAGS = $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ + $(AFLAGS) $(INCS) $(DEFS) \ + -mstackrealign \ + -fno-strict-aliasing \ + -Wall -Wundef LDFLAGS := $(LOPTS) $(DFLAGS) $(LDIR) ARFLAGS := $(AOPTS) @@ -257,6 +242,7 @@ endif # Nothing should need changing from here on.. # ######################################################################### +INCS += -Iplat/unix VPATH := plat/unix . targets #LIBS := @@ -276,8 +262,7 @@ all: $(LIBS) $(PROG) libfoo.dll.a libfoo.so: $(LOBJ) @echo Linking shared library $@ .. - @$(LINK) $(LDFLAGS) -shared -o $@ \ - $(LOBJ) + @$(LINK) $(LDFLAGS) -shared -o $@ $(LOBJ) $(if $(filter $(DEBUG),y),,@$(STRIP) --strip-unneeded $@) libfoo.a: $(LOBJ) @@ -290,15 +275,11 @@ vasm: $(OBJ) @$(LINK) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(LDLIBS) $(if $(filter $(DEBUG),y),,@$(STRIP) $@) -test: tests/hello.asm - @echo Assembling hello.asm .. - @asm6502 -v -o hello $< clean: @echo Cleaning objects.. @-rm -f *.o @-rm -f *.d - @echo Cleaning resources.. clobber: clean @@ -310,7 +291,7 @@ clobber: clean # @-rm -f $(DEPFILE) depclean: - @-del $(DEPFILE) + @-rm -f $(DEPFILE) @echo Creating dependencies.. @echo # Run "make depends" to re-create this file. >$(DEPFILE) diff --git a/src/plat/unix/Makefile.TCC b/src/plat/unix/Makefile.TCC index 5be9ac6..b7b2381 100644 --- a/src/plat/unix/Makefile.TCC +++ b/src/plat/unix/Makefile.TCC @@ -8,7 +8,7 @@ # # Makefile for Windows systems using the TCC environment. # -# Version: @(#)Makefile.TCC 1.2.0 2023/08/20 +# Version: @(#)Makefile.TCC 1.2.1 2023/09/28 # # Author: Fred N. van Kempen, # @@ -48,13 +48,13 @@ ifndef ARCH ARCH := x86 endif - ifndef DEBUG DEBUG := n endif -DEFS := -DALLOW_UNDEFINED_IF +# General options. +DEFS := -DALLOW_UNDEFINED_IF ifndef MOS6502 @@ -173,7 +173,6 @@ CC := tcc -m$(TARGET) CXX := tcc -m$(TARGET) CPP := cpp -P LINK := tcc -m$(TARGET) -WINDRES := windres AR := tcc-ar RANLIB := echo STRIP := echo @@ -182,24 +181,12 @@ ifndef CAT endif # Set up the correct toolchain flags. -OPTS := -DARCH=$(ARCH) \ - -D_CRT_NON_CONFORMING_SWPRINTFS \ - -D__USE_MINGW_ANSI_STDIO_X -ifndef VCRUNTIME - # MinGW does not provide MD/MT yet. - VCRUNTIME := MD -endif -RCOPTS := --input-format=rc -O coff -ifdef RCTARGET - RCOPTS += --target=$(RCTARGET) -endif -RCOPTS += -D RC_INVOKED -o +OPTS := -DARCH=$(ARCH) AOPTS := r -LOPTS := -mconsole +LOPTS := # General build options. ifeq ($(DEBUG), y) - VCRUNTIME := $(VCRUNTIME)d DFLAGS += -ggdb -D_DEBUG RCOPTS := -D_DEBUG $(RCOPTS) AOPTIM := @@ -218,7 +205,6 @@ else endif endif endif -OPTS += #/$(VCRUNTIME) ifeq ($(PROFILER), y) LOPTS += -Xlinker -Map=$(PROG).map endif @@ -228,11 +214,10 @@ endif CFLAGS = $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ $(AFLAGS) $(INCS) $(DEFS) \ -mstackrealign \ - -fomit-frame-pointer -fno-strict-aliasing \ - -Wall -Wundef #-Wmissing-declarations + -fno-strict-aliasing \ + -Wall -Wundef LDFLAGS := $(LOPTS) $(DFLAGS) $(LDIR) ARFLAGS := $(AOPTS) -RCFLAGS = $(RCOPTS) # Build module rules. @@ -252,19 +237,12 @@ else @$(CC) $(CFLAGS) $(DEPS) -E $< >NUL endif -# For systems that use these, compile a resource file. -.rc.res: $< - @echo Processing $< - @$(WINDRES) $(RCFLAGS) $@ $< - ######################################################################### # Nothing should need changing from here on.. # ######################################################################### -# Final fixups. INCS += -Iplat/unix - VPATH := plat/unix targets . PROG := vasm diff --git a/src/plat/win/Makefile.MSVC b/src/plat/win/Makefile.MSVC index 9ac5620..3ac07fe 100644 --- a/src/plat/win/Makefile.MSVC +++ b/src/plat/win/Makefile.MSVC @@ -8,7 +8,7 @@ # # Makefile for Windows using Visual Studio 2019. # -# Version: @(#)Makefile.MSVC 1.2.0 2023/08/20 +# Version: @(#)Makefile.MSVC 1.2.1 2023/09/28 # # Author: Fred N. van Kempen, # @@ -44,17 +44,16 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ifndef ARCH ARCH := x86 endif - ifndef DEBUG DEBUG := n endif -DEFS := -DALLOW_UNDEFINED_IF +# General options. +DEFS := -DALLOW_UNDEFINED_IF ifndef MOS6502 @@ -279,9 +278,7 @@ endif # Nothing should need changing from here on.. # ######################################################################### -# Final fixups. INCS += -Iplat/win - VPATH := plat/win . targets #LIBS := diff --git a/src/plat/win/Makefile.MinGW b/src/plat/win/Makefile.MinGW index 83bff76..8089a02 100644 --- a/src/plat/win/Makefile.MinGW +++ b/src/plat/win/Makefile.MinGW @@ -8,7 +8,7 @@ # # Makefile for Windows systems using the MinGW-w64 environment. # -# Version: @(#)Makefile.MinGW 1.2.0 2023/08/20 +# Version: @(#)Makefile.MinGW 1.2.1 2023/09/28 # # Author: Fred N. van Kempen, # @@ -48,13 +48,13 @@ ifndef ARCH ARCH := x86 endif - ifndef DEBUG DEBUG := n endif -DEFS := -DALLOW_UNDEFINED_IF +# General options. +DEFS := -DALLOW_UNDEFINED_IF ifndef MOS6502 @@ -227,8 +227,9 @@ endif # Final versions of the toolchain flags. CFLAGS = $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ $(AFLAGS) $(INCS) $(DEFS) \ - -mstackrealign -fno-strict-aliasing \ - -Wall -Wundef #-Wmissing-declarations + -mstackrealign \ + -fno-strict-aliasing \ + -Wall -Wundef LDFLAGS := $(LOPTS) $(DFLAGS) $(LDIR) ARFLAGS := $(AOPTS) RCFLAGS = $(RCOPTS) @@ -261,9 +262,7 @@ endif # Nothing should need changing from here on.. # ######################################################################### -# Final fixups. INCS += -Iplat/win - VPATH := plat/win . targets #LIBS := diff --git a/src/plat/win/Makefile.TCC b/src/plat/win/Makefile.TCC index e73953f..39271e1 100644 --- a/src/plat/win/Makefile.TCC +++ b/src/plat/win/Makefile.TCC @@ -8,7 +8,7 @@ # # Makefile for Windows systems using the TCC environment. # -# Version: @(#)Makefile.TCC 1.2.0 2023/08/20 +# Version: @(#)Makefile.TCC 1.2.1 2023/09/28 # # Author: Fred N. van Kempen, # @@ -48,13 +48,13 @@ ifndef ARCH ARCH := x86 endif - ifndef DEBUG DEBUG := n endif -DEFS := -DALLOW_UNDEFINED_IF +# General options. +DEFS := -DALLOW_UNDEFINED_IF ifndef MOS6502 @@ -185,10 +185,6 @@ endif OPTS := -DARCH=$(ARCH) \ -D_CRT_NON_CONFORMING_SWPRINTFS \ -D__USE_MINGW_ANSI_STDIO_X -ifndef VCRUNTIME - # MinGW does not provide MD/MT yet. - VCRUNTIME := MD -endif RCOPTS := --input-format=rc -O coff ifdef RCTARGET RCOPTS += --target=$(RCTARGET) @@ -199,7 +195,6 @@ LOPTS := -mconsole # General build options. ifeq ($(DEBUG), y) - VCRUNTIME := $(VCRUNTIME)d DFLAGS += -ggdb -D_DEBUG RCOPTS := -D_DEBUG $(RCOPTS) AOPTIM := @@ -218,7 +213,6 @@ else endif endif endif -OPTS += #/$(VCRUNTIME) ifeq ($(PROFILER), y) LOPTS += -Xlinker -Map=$(PROG).map endif @@ -228,8 +222,8 @@ endif CFLAGS = $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ $(AFLAGS) $(INCS) $(DEFS) \ -mstackrealign \ - -fomit-frame-pointer -fno-strict-aliasing \ - -Wall -Wundef #-Wmissing-declarations + -fno-strict-aliasing \ + -Wall -Wundef LDFLAGS := $(LOPTS) $(DFLAGS) $(LDIR) ARFLAGS := $(AOPTS) RCFLAGS = $(RCOPTS) @@ -262,9 +256,7 @@ endif # Nothing should need changing from here on.. # ######################################################################### -# Final fixups. INCS += -Iplat/win - VPATH := plat/win targets . PROG := vasm.exe