Updated makefiles.

This commit is contained in:
waltje
2023-09-28 20:22:02 -04:00
parent 558650760c
commit 3024da579f
6 changed files with 40 additions and 93 deletions

View File

@@ -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, <waltje@varcem.com>
#
@@ -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):

View File

@@ -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, <waltje@varcem.com>
#
@@ -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)

View File

@@ -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, <waltje@varcem.com>
#
@@ -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

View File

@@ -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, <waltje@varcem.com>
#
@@ -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 :=

View File

@@ -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, <waltje@varcem.com>
#
@@ -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 :=

View File

@@ -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, <waltje@varcem.com>
#
@@ -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