# ------------------------------------------------------------------------------
# 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
+
+# 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
toklist.obj \
ulabel.obj
-LIBS = ..\common\common.lib
+LIBS = ../common/common.lib
# ------------------------------------------------------------------------------
# Main targets
-all: ca65
+all: ca65
-ca65: ca65.exe
+ca65: ca65.exe
# ------------------------------------------------------------------------------
# Other targets
-ca65.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)
+ca65.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 ca65.exe del ca65.exe
strip:
- @-wstrip ca65.exe
+ @-$(WSTRIP) ca65.exe
#
-# CC65 Makefile for the Watcom compiler (using GNU make)
+# CC65 Makefile for the Watcom compiler (using GNU make) and wine
#
# ------------------------------------------------------------------------------
# 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
LIB = common.lib
+# Program arguments
+CFLAGS = -d1 -onatx -zp4 -5 -zq -w2
+
+# 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
# ------------------------------------------------------------------------------
strutil.obj \
target.obj \
tgttrans.obj \
- wildargv.obj \
xmalloc.obj \
xsprintf.obj
-
-