X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fmake%2Fwatcom.mak;h=c1f6b04af9588f05dcc08dab53da4193a51e2aa2;hb=3d1ee0f974987bbe27da2710ed40cca6af01403a;hp=ab731b54b90f7ee4a4ac6b677b48cc0773d84e64;hpb=275da22a66d69e2e5ecaa92766104833f0de767a;p=cc65 diff --git a/src/ld65/make/watcom.mak b/src/ld65/make/watcom.mak index ab731b54b..c1f6b04af 100644 --- a/src/ld65/make/watcom.mak +++ b/src/ld65/make/watcom.mak @@ -1,83 +1,81 @@ # -# ld65 Makefile for the Watcom compiler +# ld65 Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP +# Environment variables for the watcom compiler +export WATCOM = c:\\watcom +export INCLUDE = $(WATCOM)\\h -AR = WLIB -LD = WLINK +# We will use the windows compiler under linux (define as empty for windows) +export WINEDEBUG=fixme-all +WINE = wine -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +# Programs +AR = $(WINE) wlib +CC = $(WINE) wcc386 +LD = $(WINE) wlink +WSTRIP = $(WINE) wstrip -q -# --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +LNKCFG = ld.tmp -!elif $(TARGET)==DOS32 +# Program arguments +CFLAGS = -d1 -obeilr -zp4 -5 -zq -w2 -i=..\\common -# -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +# Target files +EXE = ld65.exe -!elif $(TARGET)==DOS +# Create NT programs by default +ifndef TARGET +TARGET = NT +endif -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 +# --------------------- OS2 --------------------- +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CFLAGS += -bt=$(TARGET) +endif -!elif $(TARGET)==NT +# -------------------- DOS4G -------------------- +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CFLAGS += -bt=$(TARGET) +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!else -!error -!endif - -# Add the include dir -CCCFG = $(CCCFG) -i=..\common - +ifeq ($(TARGET),NT) +SYSTEM = nt +CFLAGS += -bt=$(TARGET) +endif # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) -fo=$@ $^ # ------------------------------------------------------------------------------ # All OBJ files -OBJS = bin.obj \ +OBJS = asserts.obj \ + bin.obj \ binfmt.obj \ + cfgexpr.obj \ condes.obj \ config.obj \ + dbgfile.obj \ + dbginfo.obj \ dbgsyms.obj \ error.obj \ exports.obj \ expr.obj \ - extsyms.obj \ + extsyms.obj \ fileinfo.obj \ fileio.obj \ + filepath.obj \ fragment.obj \ global.obj \ library.obj \ @@ -89,56 +87,39 @@ OBJS = bin.obj \ objfile.obj \ scanner.obj \ segments.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) - $(LD) system $(SYSTEM) @&&| -DEBUG ALL -OPTION QUIET -NAME $< -FILE bin.obj -FILE binfmt.obj -FILE condes.obj -FILE config.obj -FILE dbgsyms.obj -FILE error.obj -FILE exports.obj -FILE expr.obj -FILE extsyms.obj -FILE fileio.obj -FILE fragment.obj -FILE global.obj -FILE library.obj -FILE main.obj -FILE mapfile.obj -FILE o65.obj -FILE objdata.obj -FILE objfile.obj -FILE scanner.obj -FILE segments.obj -FILE tgtcfg.obj -LIBRARY ..\common\common.lib -| +$(EXE): $(OBJS) $(LIBS) + @echo "DEBUG ALL" > $(LNKCFG) + @echo "OPTION QUIET" >> $(LNKCFG) + @echo "OPTION MAP" >> $(LNKCFG) + @echo "OPTION STACK=65536" >> $(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 $(OBJS) $(EXE) $(EXE:.exe=.map) strip: - @-wstrip ld65.exe + @-$(WSTRIP) $(EXE)