#INCLUDES = -I../debug -D__MEMORY_ALLOCATION__
INCLUDES =
OFLAGS = -O4 -Os
+#OFLAGS = -O0
#OFLAGS = -O4 -ffast-math -finline-functions
#OFLAGS = -O4 -finline-functions
#OFLAGS += -mtune=pentium3 -mmmx -msse -msse2 -m3dnow
# Linux
else ifneq (, $(findstring mingw, $(MAKE_HOST)))
# Windows MinGw
+CFLAGS += -DWIN32
#LDLIBS += -lws2_32
LDOPT = winlnk
else ifneq (, $(findstring cygwin, $(MAKE_HOST)))
+CFLAGS += -DWIN32
# Windows CygWin
LDOPT = winlnk
else ifneq (, $(findstring msdos, $(MAKE_HOST)))
# Targets
-ALLEXE =
-ALLEXE += tetris
+ALLEXE = $(shell for f in *.c; do grep -q '/\*\slinker:' $$f && echo $${f/.c}; done)
SHELL = bash
all: depends
$(MAKE) $(ALLEXE:%=%.exe)
+analyze:
+ make purge
+ scan-build make
+ #scan-build -stats make
+
count:
wc $(wildcard *.c *.h) $(MAKEFILE_LIST)
touch gcov
rm -f gcov $(wildcard *.gcda *.gcno)
$(MAKE) purge
- grep '#####' *.c.gcov || true
+ grep '^ *#####' *.c.gcov || true
gprof_%:
$(MAKE) purge
eval $$test; \
[ $$? -eq 0 ] && echo -e "\033[1;32mSUCCESS\033[0;0m" \
|| { echo -e "\033[1;31mFAILED\033[0;0m"; RC=1; }; \
+ test "$$RC" = 1 -a "$(STOP)" = 1 && break; \
done; \
test "$$RC" -ne 1
## Phony
-.PHONY: all clean count depends gcovs purge tests
+.PHONY: all analyze clean count depends gcovs purge tests
## Precious