#
# Use this makefile with the command
#   C:\cs30200\MinGW32\bin\mingw32-make
#
CC = C:\cs30200\lcc\bin\lcc.exe
CFLAGS = -g2 -S
LINK = C:\cs30200\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))
