From: Ash Tyndall Date: Sat, 8 Oct 2011 04:13:17 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=commitdiff_plain;h=734ee7661b2d1c9a5d3b0b857f93a790e1054deb --- diff --git a/Makefile b/Makefile index 7b4da18..8aacfe5 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,37 @@ -define MinCyg_GCC -sed -n /'^gcc version '/s',.*\<\([A-Za-z]*\)\> \(special\|experimental\).*',\\1,p -endef -define Any_GCC -sed -n /'^gcc version '/s',.*\<\([A-Za-z]*\)\>.*',\\1,p -endef - -ASK_SHELL_FIND_GCC := $(shell gcc -v 2>&1 | $(MinCyg_GCC)) - ifeq "$(ASK_SHELL_FIND_GCC)" "" -ASK_SHELL_FIND_GCC := $(shell gcc -v 2>&1 | $(Any_GCC)) - endif - ifneq "$(ASK_SHELL_FIND_GCC)" "" -GCC_FLAVOR := $(strip $(ASK_SHELL_FIND_GCC)) - endif - -ifeq "$(GCC_FLAVOR)" "cygming" -CFLAGS += -mno-cygwin -override LIBS += -lglut32 -lglu32 -lopengl32 -endif - -LIBS += -lglut -lGLU -lGL - -CFLAGS += -ggdb -Wall -std=c99 - -.PHONY: all - -all: scene commit - -scene: scene.c bitmap.c bitmap.h - gcc $(CFLAGS) -o scene scene.c bitmap.c $(LIBS) - -commit: scene.c bitmap.c bitmap.h - git commit -a --allow-empty-message --message="" --untracked-files=no - -clean: - rm scene - +define MinCyg_GCC +sed -n /'^gcc version '/s',.*\<\([A-Za-z]*\)\> \(special\|experimental\).*',\\1,p +endef +define Any_GCC +sed -n /'^gcc version '/s',.*\<\([A-Za-z]*\)\>.*',\\1,p +endef + +ASK_SHELL_FIND_GCC := $(shell gcc -v 2>&1 | $(MinCyg_GCC)) + ifeq "$(ASK_SHELL_FIND_GCC)" "" +ASK_SHELL_FIND_GCC := $(shell gcc -v 2>&1 | $(Any_GCC)) + endif + ifneq "$(ASK_SHELL_FIND_GCC)" "" +GCC_FLAVOR := $(strip $(ASK_SHELL_FIND_GCC)) + endif + +ifeq "$(GCC_FLAVOR)" "cygming" +CFLAGS += -mno-cygwin +override LIBS += -lglut32 -lglu32 -lopengl32 +endif + +LIBS += -lglut -lGLU -lGL + +CFLAGS += -ggdb -Wall -std=c99 + +.PHONY: all + +all: scene commit + +scene: scene.c bitmap.c bitmap.h + gcc $(CFLAGS) -o scene scene.c bitmap.c $(LIBS) + +commit: scene.c bitmap.c bitmap.h + git commit -a --allow-empty-message --message="" --untracked-files=no; true + +clean: + rm scene +