#
-# 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) $^
# ------------------------------------------------------------------------------
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:
@if exist ar65.exe del ar65.exe
strip:
- @-wstrip ar65.exe
+ @-wstrip ar65.exe
#
-# 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) $^
# ------------------------------------------------------------------------------
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
#
-# 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) $^
# ------------------------------------------------------------------------------
LIBS = ..\common\common.lib
-.PRECIOUS $(OBJS:.obj=.c)
-
# ------------------------------------------------------------------------------
# Main targets
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
#
-# 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) $^
# ------------------------------------------------------------------------------
global.obj \
main.obj
-.PRECIOUS $(OBJS:.obj=.c)
+LIBS = ..\common\common.lib
# ------------------------------------------------------------------------------
# Main targets
# 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
#
-# 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) $^
# ------------------------------------------------------------------------------
xsprintf.obj
-.PRECIOUS $(OBJS:.obj=.cc) $(LIB)
-
# ------------------------------------------------------------------------------
# Main targets
$(LIB): $(OBJS)
@echo Creating library...
- &@$(AR) -q -b -P=32 $(LIB) +-$?
+ $(AR) -q -b -P=32 $(LIB) $(foreach OBJ, $(OBJS), +-$(OBJ))
@echo Done!
clean:
#
-# 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) $^
# ------------------------------------------------------------------------------
# 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
#
-# 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) $^
# ------------------------------------------------------------------------------
OBJS = grc.obj
-.PRECIOUS $(OBJS:.obj=.c)
+LIBS = ..\common\common.lib
# ------------------------------------------------------------------------------
# Main targets
all: grc
+.PHONY: grc
+
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
#
-# 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) $^
# ------------------------------------------------------------------------------
# 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
ca65 \
cc65 \
cl65 \
+ da65 \
grc \
ld65 \
od65
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
#
-# 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) $^
# ------------------------------------------------------------------------------
all: od65
+.PHONY: od65
+
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