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
This commit is contained in:
cuz
2003-11-02 21:46:00 +00:00
parent e2c4314258
commit 5b3d0ddaf9
11 changed files with 357 additions and 227 deletions

View File

@@ -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)