#
# Use this makefile with the command
#   c:\mingw\bin\mingw32-make -f makefile-gcc
#
CC = c:\mingw\bin\gcc
CFLAGS = -g -Wall -fverbose-asm -Wa,-a,-adhlns=$*.asm

# This special target is needed because exe is not a "known suffix" in Unix.
.SUFFIXES: .exe

# See Section 5.4.3 of "GNU Make Manual"
# 08 July 2002, GNU make Version 3.80.
all: $(patsubst %.c,%.exe,$(wildcard *.c))

# Use a simple suffix rule to compile any c file.
# See Section 11.7 of "GNU Make Manual"
# 08 July 2002, GNU make Version 3.80.
.c.exe:
	$(CC) $(CFLAGS) -o $@ $<

# delete only the files that we made
clean:
	cmd /c del $(patsubst %.c,%.asm,$(wildcard *.c))
	cmd /c del $(patsubst %.c,%.exe,$(wildcard *.c))
