From: cuz Date: Thu, 12 Dec 2002 23:19:53 +0000 (+0000) Subject: Converted all Watcom makefiles to use GNU make X-Git-Tag: V2.12.0~1914 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a5489728ae228ecb2def5769ea5c1b9be4221fa6;p=cc65 Converted all Watcom makefiles to use GNU make git-svn-id: svn://svn.cc65.org/cc65/trunk@1745 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ar65/make/watcom.mak b/src/ar65/make/watcom.mak index 52f6fef9d..d333e0ab6 100644 --- a/src/ar65/make/watcom.mak +++ b/src/ar65/make/watcom.mak @@ -1,67 +1,43 @@ # -# ar65 Makefile for the Watcom compiler +# ar65 Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - AR = WLIB LD = WLINK - -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +LNKCFG = ld.tmp # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +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 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif +# Add the include dir +CFLAGS += -i=..\common # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -96,24 +72,13 @@ ar65: ar65.exe ar65.exe: $(OBJS) $(LIBS) - $(LD) system $(SYSTEM) @&&| -DEBUG ALL -OPTION QUIET -NAME $< -FILE add.obj -FILE del.obj -FILE error.obj -FILE exports.obj -FILE extract.obj -FILE fileio.obj -FILE global.obj -FILE library.obj -FILE list.obj -FILE main.obj -FILE objdata.obj -FILE objfile.obj -LIBRARY ..\common\common.lib -| + @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) + @rm $(LNKCFG) clean: @@ -121,5 +86,5 @@ clean: @if exist ar65.exe del ar65.exe strip: - @-wstrip ar65.exe + @-wstrip ar65.exe diff --git a/src/ca65/make/watcom.mak b/src/ca65/make/watcom.mak index 74568a771..5161a78d7 100644 --- a/src/ca65/make/watcom.mak +++ b/src/ca65/make/watcom.mak @@ -1,67 +1,43 @@ # -# CA65 Makefile for the Watcom compiler +# CA65 Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - AR = WLIB LD = WLINK - -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +LNKCFG = ld.tmp # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!else -!error -!endif +ifeq ($(TARGET),NT) +SYSTEM = nt +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # Add the include dir -CCCFG = $(CCCFG) -i=..\common - +CFLAGS += -i=..\common # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -111,39 +87,13 @@ ca65: ca65.exe ca65.exe: $(OBJS) $(LIBS) - $(LD) system $(SYSTEM) @&&| -DEBUG ALL -OPTION QUIET -NAME $< -FILE condasm.obj -FILE dbginfo.obj -FILE ea.obj -FILE error.obj -FILE expr.obj -FILE feature.obj -FILE filetab.obj -FILE fragment.obj -FILE global.obj -FILE incpath.obj -FILE instr.obj -FILE istack.obj -FILE lineinfo.obj -FILE listing.obj -FILE macpack.obj -FILE macro.obj -FILE main.obj -FILE nexttok.obj -FILE objcode.obj -FILE objfile.obj -FILE options.obj -FILE pseudo.obj -FILE repeat.obj -FILE scanner.obj -FILE symtab.obj -FILE toklist.obj -FILE ulabel.obj -LIBRARY ..\common\common.lib -| + @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) + @rm $(LNKCFG) clean: @if exist *.obj del *.obj diff --git a/src/cc65/make/watcom.mak b/src/cc65/make/watcom.mak index 95332224f..cef4d0e8a 100644 --- a/src/cc65/make/watcom.mak +++ b/src/cc65/make/watcom.mak @@ -1,67 +1,43 @@ # -# CC65 Makefile for the Watcom compiler +# CC65 Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - AR = WLIB LD = WLINK - -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +LNKCFG = ld.tmp # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!else -!error -!endif +ifeq ($(TARGET),NT) +SYSTEM = nt +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # Add the include dir -CCCFG = $(CCCFG) -i=..\common - +CFLAGS += -i=..\common # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -134,8 +110,6 @@ OBJS = anonname.obj \ LIBS = ..\common\common.lib -.PRECIOUS $(OBJS:.obj=.c) - # ------------------------------------------------------------------------------ # Main targets @@ -149,80 +123,17 @@ cc65: cc65.exe cc65.exe: $(OBJS) $(LIBS) - $(LD) system $(SYSTEM) @&&| -DEBUG ALL -OPTION QUIET -NAME $< -FILE anonname.obj -FILE asmcode.obj -FILE asmlabel.obj -FILE asmstmt.obj -FILE assignment.obj -FILE casenode.obj -FILE codeent.obj -FILE codegen.obj -FILE codelab.obj -FILE codeinfo.obj -FILE codeopt.obj -FILE codeseg.obj -FILE compile.obj -FILE coptadd.obj -FILE coptc02.obj -FILE coptcmp.obj -FILE coptind.obj -FILE coptneg.obj -FILE coptpush.obj -FILE coptsize.obj -FILE coptstop.obj -FILE coptstore.obj -FILE coptsub.obj -FILE copttest.obj -FILE cpu.obj -FILE dataseg.obj -FILE datatype.obj -FILE declare.obj -FILE declattr.obj -FILE error.obj -FILE expr.obj -FILE exprdesc.obj -FILE exprheap.obj -FILE exprnode.obj -FILE funcdesc.obj -FILE function.obj -FILE global.obj -FILE goto.obj -FILE hexval.obj -FILE ident.obj -FILE incpath.obj -FILE input.obj -FILE lineinfo.obj -FILE litpool.obj -FILE locals.obj -FILE loop.obj -FILE macrotab.obj -FILE main.obj -FILE opcodes.obj -FILE preproc.obj -FILE pragma.obj -FILE reginfo.obj -FILE scanner.obj -FILE scanstrbuf.obj -FILE segments.obj -FILE stdfunc.obj -FILE stmt.obj -FILE swstmt.obj -FILE symentry.obj -FILE symtab.obj -FILE textseg.obj -FILE typecast.obj -FILE typecmp.obj -FILE util.obj -LIBRARY ..\common\common.lib -| + @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) + @rm $(LNKCFG) clean: @if exist *.obj del *.obj - @if exist cc65.exe del cc65.exe + @if exist cc65.exe del cc65.exe strip: @-wstrip cc65.exe diff --git a/src/cl65/make/watcom.mak b/src/cl65/make/watcom.mak index 6fdb86f0c..b050b1dff 100644 --- a/src/cl65/make/watcom.mak +++ b/src/cl65/make/watcom.mak @@ -1,66 +1,43 @@ # -# CL65 Makefile for the Watcom compiler +# CL65 Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - AR = WLIB LD = WLINK - -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +LNKCFG = ld.tmp # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!else -!error -!endif +ifeq ($(TARGET),NT) +SYSTEM = nt +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # Add the include dir -CCCFG = $(CCCFG) -i=..\common +CFLAGS += -i=..\common # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -70,7 +47,7 @@ OBJS = error.obj \ global.obj \ main.obj -.PRECIOUS $(OBJS:.obj=.c) +LIBS = ..\common\common.lib # ------------------------------------------------------------------------------ # Main targets @@ -84,21 +61,18 @@ cl65: cl65.exe # Other targets -cl65.exe: $(OBJS) - $(LD) system $(SYSTEM) @&&| -DEBUG ALL -OPTION QUIET -NAME $< -FILE error.obj -FILE global.obj -FILE main.obj -LIBRARY ..\common\common.lib -| - +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) + @rm $(LNKCFG) clean: @if exist *.obj del *.obj - @if exist cl65.exe del cl65.exe + @if exist cl65.exe del cl65.exe strip: @-wstrip cl65.exe diff --git a/src/common/make/watcom.mak b/src/common/make/watcom.mak index ce59f72d5..f71b1d513 100644 --- a/src/common/make/watcom.mak +++ b/src/common/make/watcom.mak @@ -1,65 +1,41 @@ # -# CC65 Makefile for the Watcom compiler +# CC65 Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - AR = WLIB LD = WLINK - LIB = common.lib -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!else -!error -!endif +ifeq ($(TARGET),NT) +SYSTEM = nt +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -87,8 +63,6 @@ OBJS = abend.obj \ xsprintf.obj -.PRECIOUS $(OBJS:.obj=.cc) $(LIB) - # ------------------------------------------------------------------------------ # Main targets @@ -98,7 +72,7 @@ lib: $(LIB) $(LIB): $(OBJS) @echo Creating library... - &@$(AR) -q -b -P=32 $(LIB) +-$? + $(AR) -q -b -P=32 $(LIB) $(foreach OBJ, $(OBJS), +-$(OBJ)) @echo Done! clean: diff --git a/src/da65/make/watcom.mak b/src/da65/make/watcom.mak index 1f01073a6..cab12ff51 100644 --- a/src/da65/make/watcom.mak +++ b/src/da65/make/watcom.mak @@ -1,67 +1,43 @@ # -# da65 Makefile for the Watcom compiler +# da65 Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - -AR = WLIB -LD = WLINK - -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +AR = WLIB +LD = WLINK +LNKCFG = ld.tmp # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!else -!error -!endif +ifeq ($(TARGET),NT) +SYSTEM = nt +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # Add the include dir -CCCFG = $(CCCFG) -i=..\common - +CFLAGS += -i=..\common # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -96,25 +72,14 @@ da65: da65.exe # Other targets -da65.exe: $(OBJS) $(LIBS) - $(LD) system $(SYSTEM) @&&| -DEBUG ALL -OPTION QUIET -NAME $< -FILE attrtab.obj -FILE code.obj -FILE config.obj -FILE cpu.obj -FILE data.obj -FILE error.obj -FILE global.obj -FILE handler.obj -FILE main.obj -FILE opctable.obj -FILE output.obj -FILE scanner.obj -LIBRARY ..\common\common.lib -| +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) + @rm $(LNKCFG) clean: @if exist *.obj del *.obj diff --git a/src/grc/make/watcom.mak b/src/grc/make/watcom.mak index 3b280495f..91818665f 100644 --- a/src/grc/make/watcom.mak +++ b/src/grc/make/watcom.mak @@ -1,63 +1,43 @@ # -# GRC Makefile for the Watcom compiler +# GRC Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - AR = WLIB LD = WLINK - -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +LNKCFG = ld.tmp # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +ifeq ($(TARGET),NT) +SYSTEM = nt +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif -!else -!error -!endif +# Add the include dir +CFLAGS += -i=..\common # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -65,13 +45,15 @@ CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 OBJS = grc.obj -.PRECIOUS $(OBJS:.obj=.c) +LIBS = ..\common\common.lib # ------------------------------------------------------------------------------ # Main targets all: grc +.PHONY: grc + grc: grc.exe @@ -79,19 +61,18 @@ grc: grc.exe # Other targets -grc.exe: $(OBJS) - $(LD) system $(SYSTEM) @&&| -DEBUG ALL -OPTION QUIET -NAME $< -FILE grc.obj -LIBRARY ..\common\common.lib -| - +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) + @rm $(LNKCFG) clean: @if exist *.obj del *.obj - @if exist grc.exe del grc.exe + @if exist grc.exe del grc.exe strip: @-wstrip grc.exe diff --git a/src/ld65/make/watcom.mak b/src/ld65/make/watcom.mak index 88ff18ddb..b14fd45a2 100644 --- a/src/ld65/make/watcom.mak +++ b/src/ld65/make/watcom.mak @@ -1,67 +1,43 @@ # -# ld65 Makefile for the Watcom compiler +# ld65 Makefile for the Watcom compiler (using GNU make) # # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - AR = WLIB LD = WLINK - -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +LNKCFG = ld.tmp # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!else -!error -!endif +ifeq ($(TARGET),NT) +SYSTEM = nt +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # Add the include dir -CCCFG = $(CCCFG) -i=..\common - +CFLAGS += -i=..\common # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -107,37 +83,15 @@ ld65: ld65.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 dbginfo.obj -FILE dbgsyms.obj -FILE error.obj -FILE exports.obj -FILE expr.obj -FILE extsyms.obj -FILE fileinfo.obj -FILE fileio.obj -FILE fragment.obj -FILE global.obj -FILE library.obj -FILE lineinfo.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 -| +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) + @rm $(LNKCFG) + clean: @if exist *.obj del *.obj diff --git a/src/make/watcom.mak b/src/make/watcom.mak index 1d3b3a27f..b5a86aec6 100644 --- a/src/make/watcom.mak +++ b/src/make/watcom.mak @@ -8,6 +8,7 @@ SUBDIRS = \ ca65 \ cc65 \ cl65 \ + da65 \ grc \ ld65 \ od65 @@ -16,107 +17,20 @@ all: nt nt: - cd common - make -f make\watcom.mak - cd ..\ar65 - make -f make\watcom.mak - cd ..\ca65 - make -f make\watcom.mak - cd ..\cc65 - make -f make\watcom.mak - cd ..\cl65 - make -f make\watcom.mak - cd ..\da65 - make -f make\watcom.mak - cd ..\grc - make -f make\watcom.mak - cd ..\ld65 - make -f make\watcom.mak - cd ..\od65 - make -f make\watcom.mak - cd .. + for %%i in ($(SUBDIRS)) do $(MAKE) TARGET=NT -C %%i -f make\watcom.mak + dos: - cd common - make -DTARGET=DOS32 -f make\watcom.mak - cd ..\ar65 - make -DTARGET=DOS32 -f make\watcom.mak - cd ..\ca65 - make -DTARGET=DOS32 -f make\watcom.mak - cd ..\cc65 - make -DTARGET=DOS32 -f make\watcom.mak - cd ..\cl65 - make -DTARGET=DOS32 -f make\watcom.mak - cd ..\da65 - make -DTARGET=DOS32 -f make\watcom.mak - cd ..\grc - make -DTARGET=DOS32 -f make\watcom.mak - cd ..\ld65 - make -DTARGET=DOS32 -f make\watcom.mak - cd ..\od65 - make -DTARGET=DOS32 -f make\watcom.mak - cd .. + for %%i in ($(SUBDIRS)) do $(MAKE) TARGET=DOS32 -C %%i -f make\watcom.mak os2: - cd common - make -DTARGET=OS2 -f make\watcom.mak - cd ..\ar65 - make -DTARGET=OS2 -f make\watcom.mak - cd ..\ca65 - make -DTARGET=OS2 -f make\watcom.mak - cd ..\cc65 - make -DTARGET=OS2 -f make\watcom.mak - cd ..\cl65 - make -DTARGET=OS2 -f make\watcom.mak - cd ..\da65 - make -DTARGET=OS2 -f make\watcom.mak - cd ..\grc - make -DTARGET=OS2 -f make\watcom.mak - cd ..\ld65 - make -DTARGET=OS2 -f make\watcom.mak - cd ..\od65 - make -DTARGET=OS2 -f make\watcom.mak - cd .. + for %%i in ($(SUBDIRS)) do $(MAKE) TARGET=OS2 -C %%i -f make\watcom.mak clean: - cd common - make -f make\watcom.mak clean - cd ..\ar65 - make -f make\watcom.mak clean - cd ..\ca65 - make -f make\watcom.mak clean - cd ..\cc65 - make -f make\watcom.mak clean - cd ..\cl65 - make -f make\watcom.mak clean - cd ..\da65 - make -f make\watcom.mak clean - cd ..\grc - make -f make\watcom.mak clean - cd ..\ld65 - make -f make\watcom.mak clean - cd ..\od65 - make -f make\watcom.mak clean - cd .. + for %%i in ($(SUBDIRS)) do $(MAKE) -C %%i -f make\watcom.mak clean strip: - @cd ar65 - @-make -f make\watcom.mak strip - @cd ..\ca65 - @-make -f make\watcom.mak strip - @cd ..\cc65 - @-make -f make\watcom.mak strip - @cd ..\cl65 - @-make -f make\watcom.mak strip - @cd ..\da65 - @-make -f make\watcom.mak strip - @cd ..\grc - @-make -f make\watcom.mak strip - @cd ..\ld65 - @-make -f make\watcom.mak strip - @cd ..\od65 - @-make -f make\watcom.mak strip - @cd .. + for %%i in ($(SUBDIRS)) do $(MAKE) -C %%i -f make\watcom.mak strip diff --git a/src/od65/make/watcom.mak b/src/od65/make/watcom.mak index 7c776e5e6..0cd38a28a 100644 --- a/src/od65/make/watcom.mak +++ b/src/od65/make/watcom.mak @@ -1,67 +1,43 @@ # -# OD65 Makefile for the Watcom compiler +# OD65 Makefile for the Watcom compiler (using GNU make) # - + # ------------------------------------------------------------------------------ # Generic stuff -.AUTODEPEND -.SUFFIXES .ASM .C .CC .CPP -.SWAP - -AR = WLIB -LD = WLINK - -!if !$d(TARGET) -!if $d(__OS2__) -TARGET = OS2 -!else -TARGET = NT -!endif -!endif - -# target specific macros. -!if $(TARGET)==OS2 +AR = WLIB +LD = WLINK +LNKCFG = ld.tmp # --------------------- OS2 --------------------- -SYSTEM = os2v2 -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS32 +ifeq ($(TARGET),OS2) +SYSTEM = os2v2 +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # -------------------- DOS4G -------------------- -SYSTEM = dos4g -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!elif $(TARGET)==DOS - -# --------------------- DOS --------------------- -SYSTEM = dos -CC = WCC -CCCFG = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2 - -!elif $(TARGET)==NT +ifeq ($(TARGET),DOS32) +SYSTEM = dos4g +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # --------------------- NT ---------------------- -SYSTEM = nt -CC = WCC386 -CCCFG = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 - -!else -!error -!endif +ifeq ($(TARGET),NT) +SYSTEM = nt +CC = WCC386 +CFLAGS = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2 +endif # Add the include dir -CCCFG = $(CCCFG) -i=..\common - +CFLAGS += -i=..\common # ------------------------------------------------------------------------------ # Implicit rules -.c.obj: - $(CC) $(CCCFG) $< +%.obj: %.c + $(CC) $(CFLAGS) $^ # ------------------------------------------------------------------------------ @@ -81,6 +57,8 @@ LIBS = ..\common\common.lib all: od65 +.PHONY: od65 + od65: od65.exe @@ -89,21 +67,17 @@ od65: od65.exe od65.exe: $(OBJS) $(LIBS) - $(LD) system $(SYSTEM) @&&| -DEBUG ALL -OPTION QUIET -NAME $< -FILE dump.obj -FILE error.obj -FILE fileio.obj -FILE global.obj -FILE main.obj -LIBRARY ..\common\common.lib -| + @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) + @rm $(LNKCFG) clean: - @if exist *.obj del *.obj - @if exist od65.exe del od65.exe + @if exist *.obj del *.obj + @if exist od65.exe del od65.exe strip: @-wstrip od65.exe