#
# Use this makefile with the command
#   c:\mingw\bin\mingw32-make
#
CC = c:\lcc\bin\lcc
CFLAGS = -g2 -S
LINK = c:\lcc\bin\lcclnk
LINKFLAGS = -subsystem console

# This special target is needed because exe and obj are not "known suffixes" in Unix.
.SUFFIXES: .exe .obj

# See Section 5.4.3 of "GNU Make Manual"
# 08 July 2002, GNU make Version 3.80.
all: $(patsubst %.c,%.exe,$(wildcard *.c))

# Use simple suffix rules to make obj and exe files.
# See Section 11.7 of "GNU Make Manual"
# 08 July 2002, GNU make Version 3.80.
.obj.exe:
	$(LINK) $(LINKFLAGS) $<

.c.obj:
	$(CC) $(CFLAGS) $<

clean:
	cmd /c del $(patsubst %.c,%.asm,$(wildcard *.c))
	cmd /c del $(patsubst %.c,%.exe,$(wildcard *.c))
	cmd /c del $(patsubst %.c,%.obj,$(wildcard *.c))
