# ------------------------------------------------------------------------------
# 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
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)
# 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
# ------------------------------------------------------------------------------
# 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)
@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)
# ------------------------------------------------------------------------------
# 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
# ------------------------------------------------------------------------------
-# All library OBJ files
+# All OBJ files
OBJS = anonname.obj \
asmcode.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)
# ------------------------------------------------------------------------------
# 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
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)
# ------------------------------------------------------------------------------
# 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
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)
@echo Done!
clean:
- @if exist *.obj del *.obj
- @if exist $(LIB) del $(LIB)
+ @rm -f *~ core
+
+zap: clean
+ @rm -f *.obj $(LIB)
+
# ------------------------------------------------------------------------------
# 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
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)
# ------------------------------------------------------------------------------
# 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
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)
# ------------------------------------------------------------------------------
# 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
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)
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
# ------------------------------------------------------------------------------
# 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
# ------------------------------------------------------------------------------
-# All library OBJ files
+# All OBJ files
OBJS = dump.obj \
error.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)