From 5b3d0ddaf9eeefc8eb163e20d9ba2a0c66467c5d Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 2 Nov 2003 21:46:00 +0000 Subject: [PATCH] Convert the watcom makefiles for use with wine under Linux git-svn-id: svn://svn.cc65.org/cc65/trunk@2598 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ar65/make/watcom.mak | 68 +++++++++++++++++++++--------------- src/ca65/make/watcom.mak | 17 +++++---- src/cc65/make/watcom.mak | 70 +++++++++++++++++++++++--------------- src/cl65/make/watcom.mak | 68 ++++++++++++++++++++++-------------- src/co65/make/watcom.mak | 66 +++++++++++++++++++++-------------- src/common/make/watcom.mak | 7 ++-- src/da65/make/watcom.mak | 66 +++++++++++++++++++++-------------- src/grc/make/watcom.mak | 70 +++++++++++++++++++++++--------------- src/ld65/make/watcom.mak | 67 ++++++++++++++++++++++-------------- src/make/watcom.mak | 15 ++++---- src/od65/make/watcom.mak | 70 +++++++++++++++++++++++--------------- 11 files changed, 357 insertions(+), 227 deletions(-) diff --git a/src/ar65/make/watcom.mak b/src/ar65/make/watcom.mak index d333e0ab6..c3b877fa0 100644 --- a/src/ar65/make/watcom.mak +++ b/src/ar65/make/watcom.mak @@ -5,34 +5,50 @@ # ------------------------------------------------------------------------------ # Generic stuff -AR = WLIB -LD = WLINK +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h + +# We will use the windows compiler under linux (define as empty for windows) +WINE = wine -- + +# Programs +AR = $(WINE) WLIB +CC = $(WINE) WCC386 +LD = $(WINE) WLINK +WSTRIP = $(WINE) WSTRIP + LNKCFG = ld.tmp +# Program arguments +CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common + +# Target files +EXE = ar65.exe + +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif + # --------------------- OS2 --------------------- ifeq ($(TARGET),OS2) SYSTEM = os2v2 -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # -------------------- DOS4G -------------------- ifeq ($(TARGET),DOS32) SYSTEM = dos4g -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # --------------------- NT ---------------------- ifeq ($(TARGET),NT) SYSTEM = nt -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif -# Add the include dir -CFLAGS += -i=..\common - # ------------------------------------------------------------------------------ # Implicit rules @@ -56,35 +72,33 @@ OBJS = add.obj \ objdata.obj \ objfile.obj -LIBS = ..\common\common.lib +LIBS = ../common/common.lib # ------------------------------------------------------------------------------ # Main targets -all: ar65 - -ar65: ar65.exe - +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -ar65.exe: $(OBJS) $(LIBS) - @echo DEBUG ALL > $(LNKCFG) - @echo OPTION QUIET >> $(LNKCFG) - @echo NAME $@ >> $(LNKCFG) - @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG) - @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG) - $(LD) system $(SYSTEM) @$(LNKCFG) +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "NAME $@" >> $(LNKCFG) + @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG) + @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG) + @$(LD) system $(SYSTEM) @$(LNKCFG) @rm $(LNKCFG) - clean: - @if exist *.obj del *.obj - @if exist ar65.exe del ar65.exe + @rm -f *~ core + +zap: clean + @rm -f *.obj $(EXE) strip: - @-wstrip ar65.exe + @-$(WSTRIP) $(EXE) diff --git a/src/ca65/make/watcom.mak b/src/ca65/make/watcom.mak index e1ce7f0cb..dc0ff3861 100644 --- a/src/ca65/make/watcom.mak +++ b/src/ca65/make/watcom.mak @@ -23,6 +23,9 @@ LNKCFG = ld.tmp # Program arguments CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common +# Target files +EXE = ca65.exe + # Create NT programs by default ifndef TARGET TARGET = NT @@ -95,16 +98,14 @@ LIBS = ../common/common.lib # ------------------------------------------------------------------------------ # Main targets -all: ca65 - -ca65: ca65.exe +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -ca65.exe: $(OBJS) $(LIBS) +$(EXE): $(OBJS) $(LIBS) @echo "DEBUG ALL" > $(LNKCFG) @echo "OPTION QUIET" >> $(LNKCFG) @echo "NAME $@" >> $(LNKCFG) @@ -114,9 +115,11 @@ ca65.exe: $(OBJS) $(LIBS) @rm $(LNKCFG) clean: - @if exist *.obj del *.obj - @if exist ca65.exe del ca65.exe + @rm -f *~ core + +zap: clean + @rm -f *.obj $(EXE) strip: - @-$(WSTRIP) ca65.exe + @-$(WSTRIP) $(EXE) diff --git a/src/cc65/make/watcom.mak b/src/cc65/make/watcom.mak index 20c6bb737..101bf5c07 100644 --- a/src/cc65/make/watcom.mak +++ b/src/cc65/make/watcom.mak @@ -5,34 +5,50 @@ # ------------------------------------------------------------------------------ # Generic stuff -AR = WLIB -LD = WLINK +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h + +# We will use the windows compiler under linux (define as empty for windows) +WINE = wine -- + +# Programs +AR = $(WINE) WLIB +CC = $(WINE) WCC386 +LD = $(WINE) WLINK +WSTRIP = $(WINE) WSTRIP + LNKCFG = ld.tmp +# Program arguments +CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common + +# Target files +EXE = cc65.exe + +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif + # --------------------- OS2 --------------------- ifeq ($(TARGET),OS2) SYSTEM = os2v2 -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # -------------------- DOS4G -------------------- ifeq ($(TARGET),DOS32) SYSTEM = dos4g -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # --------------------- NT ---------------------- ifeq ($(TARGET),NT) SYSTEM = nt -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif -# Add the include dir -CFLAGS += -i=..\common - # ------------------------------------------------------------------------------ # Implicit rules @@ -41,7 +57,7 @@ CFLAGS += -i=..\common # ------------------------------------------------------------------------------ -# All library OBJ files +# All OBJ files OBJS = anonname.obj \ asmcode.obj \ @@ -107,34 +123,34 @@ OBJS = anonname.obj \ typeconv.obj \ util.obj -LIBS = ..\common\common.lib +LIBS = ../common/common.lib + # ------------------------------------------------------------------------------ # Main targets -all: cc65 - -cc65: cc65.exe +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -cc65.exe: $(OBJS) $(LIBS) - @echo DEBUG ALL > $(LNKCFG) - @echo OPTION QUIET >> $(LNKCFG) - @echo NAME $@ >> $(LNKCFG) - @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG) - @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG) - $(LD) system $(SYSTEM) @$(LNKCFG) +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "NAME $@" >> $(LNKCFG) + @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG) + @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG) + @$(LD) system $(SYSTEM) @$(LNKCFG) @rm $(LNKCFG) clean: - @if exist *.obj del *.obj - @if exist cc65.exe del cc65.exe + @rm -f *~ core -strip: - @-wstrip cc65.exe +zap: clean + @rm -f *.obj $(EXE) +strip: + @-$(WSTRIP) $(EXE) diff --git a/src/cl65/make/watcom.mak b/src/cl65/make/watcom.mak index b050b1dff..1e224d86b 100644 --- a/src/cl65/make/watcom.mak +++ b/src/cl65/make/watcom.mak @@ -5,34 +5,50 @@ # ------------------------------------------------------------------------------ # Generic stuff -AR = WLIB -LD = WLINK +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h + +# We will use the windows compiler under linux (define as empty for windows) +WINE = wine -- + +# Programs +AR = $(WINE) WLIB +CC = $(WINE) WCC386 +LD = $(WINE) WLINK +WSTRIP = $(WINE) WSTRIP + LNKCFG = ld.tmp +# Program arguments +CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common + +# Target files +EXE = cl65.exe + +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif + # --------------------- OS2 --------------------- ifeq ($(TARGET),OS2) SYSTEM = os2v2 -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # -------------------- DOS4G -------------------- ifeq ($(TARGET),DOS32) SYSTEM = dos4g -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # --------------------- NT ---------------------- ifeq ($(TARGET),NT) SYSTEM = nt -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif -# Add the include dir -CFLAGS += -i=..\common - # ------------------------------------------------------------------------------ # Implicit rules @@ -47,34 +63,34 @@ OBJS = error.obj \ global.obj \ main.obj -LIBS = ..\common\common.lib +LIBS = ../common/common.lib + # ------------------------------------------------------------------------------ # Main targets -all: cl65 - -cl65: cl65.exe +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -cl65.exe: $(OBJS) $(LIBS) - @echo DEBUG ALL > $(LNKCFG) - @echo OPTION QUIET >> $(LNKCFG) - @echo NAME $@ >> $(LNKCFG) - @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG) - @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG) - $(LD) system $(SYSTEM) @$(LNKCFG) +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "NAME $@" >> $(LNKCFG) + @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG) + @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG) + @$(LD) system $(SYSTEM) @$(LNKCFG) @rm $(LNKCFG) clean: - @if exist *.obj del *.obj - @if exist cl65.exe del cl65.exe + @rm -f *~ core -strip: - @-wstrip cl65.exe +zap: clean + @rm -f *.obj $(EXE) +strip: + @-$(WSTRIP) $(EXE) diff --git a/src/co65/make/watcom.mak b/src/co65/make/watcom.mak index 401adea7f..a9669af5a 100644 --- a/src/co65/make/watcom.mak +++ b/src/co65/make/watcom.mak @@ -5,34 +5,50 @@ # ------------------------------------------------------------------------------ # Generic stuff -AR = WLIB -LD = WLINK +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h + +# We will use the windows compiler under linux (define as empty for windows) +WINE = wine -- + +# Programs +AR = $(WINE) WLIB +CC = $(WINE) WCC386 +LD = $(WINE) WLINK +WSTRIP = $(WINE) WSTRIP + LNKCFG = ld.tmp +# Program arguments +CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common + +# Target files +EXE = co65.exe + +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif + # --------------------- OS2 --------------------- ifeq ($(TARGET),OS2) SYSTEM = os2v2 -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # -------------------- DOS4G -------------------- ifeq ($(TARGET),DOS32) SYSTEM = dos4g -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # --------------------- NT ---------------------- ifeq ($(TARGET),NT) SYSTEM = nt -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif -# Add the include dir -CFLAGS += -i=..\common - # ------------------------------------------------------------------------------ # Implicit rules @@ -51,34 +67,34 @@ OBJS = convert.obj \ model.obj \ o65.obj -LIBS = ..\common\common.lib +LIBS = ../common/common.lib # ------------------------------------------------------------------------------ # Main targets -all: co65 - -co65: co65.exe +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -co65.exe: $(OBJS) $(LIBS) - @echo DEBUG ALL > $(LNKCFG) - @echo OPTION QUIET >> $(LNKCFG) - @echo NAME $@ >> $(LNKCFG) - @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG) - @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG) - $(LD) system $(SYSTEM) @$(LNKCFG) +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "NAME $@" >> $(LNKCFG) + @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG) + @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG) + @$(LD) system $(SYSTEM) @$(LNKCFG) @rm $(LNKCFG) clean: - @if exist *.obj del *.obj - @if exist co65.exe del co65.exe + @rm -f *~ core + +zap: clean + @rm -f *.obj $(EXE) strip: - @-wstrip co65.exe + @-$(WSTRIP) $(EXE) diff --git a/src/common/make/watcom.mak b/src/common/make/watcom.mak index f59878c9a..0147ddf12 100644 --- a/src/common/make/watcom.mak +++ b/src/common/make/watcom.mak @@ -95,8 +95,11 @@ $(LIB): $(OBJS) @echo Done! clean: - @if exist *.obj del *.obj - @if exist $(LIB) del $(LIB) + @rm -f *~ core + +zap: clean + @rm -f *.obj $(LIB) + diff --git a/src/da65/make/watcom.mak b/src/da65/make/watcom.mak index ce34bd6d0..12457dab9 100644 --- a/src/da65/make/watcom.mak +++ b/src/da65/make/watcom.mak @@ -5,34 +5,50 @@ # ------------------------------------------------------------------------------ # Generic stuff -AR = WLIB -LD = WLINK +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h + +# We will use the windows compiler under linux (define as empty for windows) +WINE = wine -- + +# Programs +AR = $(WINE) WLIB +CC = $(WINE) WCC386 +LD = $(WINE) WLINK +WSTRIP = $(WINE) WSTRIP + LNKCFG = ld.tmp +# Program arguments +CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common + +# Target files +EXE = da65.exe + +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif + # --------------------- OS2 --------------------- ifeq ($(TARGET),OS2) SYSTEM = os2v2 -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # -------------------- DOS4G -------------------- ifeq ($(TARGET),DOS32) SYSTEM = dos4g -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # --------------------- NT ---------------------- ifeq ($(TARGET),NT) SYSTEM = nt -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif -# Add the include dir -CFLAGS += -i=..\common - # ------------------------------------------------------------------------------ # Implicit rules @@ -60,34 +76,34 @@ OBJS = attrtab.obj \ scanner.obj -LIBS = ..\common\common.lib +LIBS = ../common/common.lib # ------------------------------------------------------------------------------ # Main targets -all: da65 - -da65: da65.exe +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -da65.exe: $(OBJS) $(LIBS) - @echo DEBUG ALL > $(LNKCFG) - @echo OPTION QUIET >> $(LNKCFG) - @echo NAME $@ >> $(LNKCFG) - @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG) - @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG) - $(LD) system $(SYSTEM) @$(LNKCFG) +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "NAME $@" >> $(LNKCFG) + @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG) + @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG) + @$(LD) system $(SYSTEM) @$(LNKCFG) @rm $(LNKCFG) clean: - @if exist *.obj del *.obj - @if exist *.obj del da65.exe + @rm -f *~ core + +zap: clean + @rm -f *.obj $(EXE) strip: - @-wstrip da65.exe + @-$(WSTRIP) $(EXE) diff --git a/src/grc/make/watcom.mak b/src/grc/make/watcom.mak index 91818665f..27dc57026 100644 --- a/src/grc/make/watcom.mak +++ b/src/grc/make/watcom.mak @@ -5,34 +5,50 @@ # ------------------------------------------------------------------------------ # Generic stuff -AR = WLIB -LD = WLINK +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h + +# We will use the windows compiler under linux (define as empty for windows) +WINE = wine -- + +# Programs +AR = $(WINE) WLIB +CC = $(WINE) WCC386 +LD = $(WINE) WLINK +WSTRIP = $(WINE) WSTRIP + LNKCFG = ld.tmp +# Program arguments +CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common + +# Target files +EXE = grc.exe + +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif + # --------------------- OS2 --------------------- ifeq ($(TARGET),OS2) SYSTEM = os2v2 -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # -------------------- DOS4G -------------------- ifeq ($(TARGET),DOS32) SYSTEM = dos4g -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # --------------------- NT ---------------------- ifeq ($(TARGET),NT) SYSTEM = nt -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif -# Add the include dir -CFLAGS += -i=..\common - # ------------------------------------------------------------------------------ # Implicit rules @@ -45,36 +61,34 @@ CFLAGS += -i=..\common OBJS = grc.obj -LIBS = ..\common\common.lib +LIBS = ../common/common.lib + # ------------------------------------------------------------------------------ # Main targets -all: grc - -.PHONY: grc - -grc: grc.exe +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -grc.exe: $(OBJS) $(LIBS) - @echo DEBUG ALL > $(LNKCFG) - @echo OPTION QUIET >> $(LNKCFG) - @echo NAME $@ >> $(LNKCFG) - @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG) - @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG) - $(LD) system $(SYSTEM) @$(LNKCFG) +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "NAME $@" >> $(LNKCFG) + @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG) + @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG) + @$(LD) system $(SYSTEM) @$(LNKCFG) @rm $(LNKCFG) clean: - @if exist *.obj del *.obj - @if exist grc.exe del grc.exe + @rm -f *~ core -strip: - @-wstrip grc.exe +zap: clean + @rm -f *.obj $(EXE) +strip: + @-$(WSTRIP) $(EXE) diff --git a/src/ld65/make/watcom.mak b/src/ld65/make/watcom.mak index 4e452785e..fdc16cc84 100644 --- a/src/ld65/make/watcom.mak +++ b/src/ld65/make/watcom.mak @@ -5,34 +5,50 @@ # ------------------------------------------------------------------------------ # Generic stuff -AR = WLIB -LD = WLINK +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h + +# We will use the windows compiler under linux (define as empty for windows) +WINE = wine -- + +# Programs +AR = $(WINE) WLIB +CC = $(WINE) WCC386 +LD = $(WINE) WLINK +WSTRIP = $(WINE) WSTRIP + LNKCFG = ld.tmp +# Program arguments +CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common + +# Target files +EXE = ld65.exe + +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif + # --------------------- OS2 --------------------- ifeq ($(TARGET),OS2) SYSTEM = os2v2 -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # -------------------- DOS4G -------------------- ifeq ($(TARGET),DOS32) SYSTEM = dos4g -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # --------------------- NT ---------------------- ifeq ($(TARGET),NT) SYSTEM = nt -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif -# Add the include dir -CFLAGS += -i=..\common - # ------------------------------------------------------------------------------ # Implicit rules @@ -72,35 +88,34 @@ OBJS = asserts.obj \ spool.obj \ tgtcfg.obj -LIBS = ..\common\common.lib +LIBS = ../common/common.lib # ------------------------------------------------------------------------------ # Main targets -all: ld65 - -ld65: ld65.exe +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -ld65.exe: $(OBJS) $(LIBS) - @echo DEBUG ALL > $(LNKCFG) - @echo OPTION QUIET >> $(LNKCFG) - @echo NAME $@ >> $(LNKCFG) - @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG) - @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG) - $(LD) system $(SYSTEM) @$(LNKCFG) +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "NAME $@" >> $(LNKCFG) + @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG) + @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG) + @$(LD) system $(SYSTEM) @$(LNKCFG) @rm $(LNKCFG) - clean: - @if exist *.obj del *.obj - @if exist *.obj del ld65.exe + @rm -f *~ core + +zap: clean + @rm -f *.obj $(EXE) strip: - @-wstrip ld65.exe + @-$(WSTRIP) $(EXE) diff --git a/src/make/watcom.mak b/src/make/watcom.mak index b416275f1..084bc04da 100644 --- a/src/make/watcom.mak +++ b/src/make/watcom.mak @@ -17,21 +17,24 @@ SUBDIRS = \ all: nt -nt: - for %%i in ($(SUBDIRS)) do $(MAKE) TARGET=NT -C %%i -f make\watcom.mak +nt: + for i in $(SUBDIRS); do $(MAKE) TARGET=NT -C $${i} -f make/watcom.mak; done dos: - for %%i in ($(SUBDIRS)) do $(MAKE) TARGET=DOS32 -C %%i -f make\watcom.mak + for i in $(SUBDIRS); do $(MAKE) TARGET=DOS32 -C $${i} -f make/watcom.mak; done os2: - for %%i in ($(SUBDIRS)) do $(MAKE) TARGET=OS2 -C %%i -f make\watcom.mak + for i in $(SUBDIRS); do $(MAKE) TARGET=OS2 -C $${i} -f make/watcom.mak; done clean: - for %%i in ($(SUBDIRS)) do $(MAKE) -C %%i -f make\watcom.mak clean + for i in $(SUBDIRS); do $(MAKE) -C $${i} -f make/watcom.mak clean; done + +zap: + for i in $(SUBDIRS); do $(MAKE) -C $${i} -f make/watcom.mak zap; done strip: - for %%i in ($(SUBDIRS)) do $(MAKE) -C %%i -f make\watcom.mak strip + for i in $(SUBDIRS); do $(MAKE) -C $${i} -f make/watcom.mak strip; done diff --git a/src/od65/make/watcom.mak b/src/od65/make/watcom.mak index 0cd38a28a..f5729fef2 100644 --- a/src/od65/make/watcom.mak +++ b/src/od65/make/watcom.mak @@ -5,34 +5,50 @@ # ------------------------------------------------------------------------------ # Generic stuff -AR = WLIB -LD = WLINK +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h + +# We will use the windows compiler under linux (define as empty for windows) +WINE = wine -- + +# Programs +AR = $(WINE) WLIB +CC = $(WINE) WCC386 +LD = $(WINE) WLINK +WSTRIP = $(WINE) WSTRIP + LNKCFG = ld.tmp +# Program arguments +CFLAGS = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common + +# Target files +EXE = od65.exe + +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif + # --------------------- OS2 --------------------- ifeq ($(TARGET),OS2) SYSTEM = os2v2 -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # -------------------- DOS4G -------------------- ifeq ($(TARGET),DOS32) SYSTEM = dos4g -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif # --------------------- NT ---------------------- ifeq ($(TARGET),NT) SYSTEM = nt -CC = WCC386 -CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +CFLAGS += -bt=$(TARGET) endif -# Add the include dir -CFLAGS += -i=..\common - # ------------------------------------------------------------------------------ # Implicit rules @@ -41,7 +57,7 @@ CFLAGS += -i=..\common # ------------------------------------------------------------------------------ -# All library OBJ files +# All OBJ files OBJS = dump.obj \ error.obj \ @@ -49,36 +65,34 @@ OBJS = dump.obj \ global.obj \ main.obj -LIBS = ..\common\common.lib +LIBS = ../common/common.lib # ------------------------------------------------------------------------------ # Main targets -all: od65 - -.PHONY: od65 - -od65: od65.exe +all: $(EXE) # ------------------------------------------------------------------------------ # Other targets -od65.exe: $(OBJS) $(LIBS) - @echo DEBUG ALL > $(LNKCFG) - @echo OPTION QUIET >> $(LNKCFG) - @echo NAME $@ >> $(LNKCFG) - @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG) - @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG) - $(LD) system $(SYSTEM) @$(LNKCFG) +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "NAME $@" >> $(LNKCFG) + @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG) + @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG) + @$(LD) system $(SYSTEM) @$(LNKCFG) @rm $(LNKCFG) clean: - @if exist *.obj del *.obj - @if exist od65.exe del od65.exe + @rm -f *~ core + +zap: clean + @rm -f *.obj $(EXE) strip: - @-wstrip od65.exe + @-$(WSTRIP) $(EXE) -- 2.39.5