#
# NOTE: This is a make file for gnu make and gcc but
#       it can compile Win32 programs because gcc for
#       cygwin includes a form of MinGW. But gcc cannot
#       compile the imbedded assembly language in the
#       files race5s.c and race5se.c.
#
#       Try comparing the assembly language code generated by gcc
#       with the code generated by Microsoft's compiler cl.
#
#       Use this make file in a bash shell with the command
#       make -f Makefile-for-gcc
#
CC = gcc
CFLAGS = -g -Wall -I . -fverbose-asm -Wa,-a,-ahlsd=$*.s
FFORCE = -fforce-mem

.SUFFIXES: .c .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
# use the FFORCE flag in order to see the race condition in badcnt.c
.c.exe:
	$(CC) $(CFLAGS) -o $*.exe $<
#	$(CC) $(CFLAGS) $(FFORCE) -o $*.exe $<

clean:
	rm -v *.exe
	rm -v *.s
