X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=Makefile;h=1e33bb5663b4b6415ece08cc682c5420bcf30042;hp=d410e7ca3b2ea99941b2da56fd258fe9a2a3a10d;hb=200ca9e125bc7e42d47ad48d0d79c975ffb02535;hpb=c012f7cd9295d346519ed24e16e78ce5d553f329 diff --git a/Makefile b/Makefile index d410e7c..1e33bb5 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,40 @@ -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 += -O3 -Wall -std=c99 - -.PHONY: all - -all: scene - -scene: scene.c bitmap.c bitmap.h - gcc $(CFLAGS) -o scene scene.c bitmap.c $(LIBS) && git commit -a -m "makefile commit" +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 + +FILES=scene.c scene.h bitmap.c bitmap.h globals.c globals.h helper.c helper.h types.h +EXENAME=scene + +.PHONY: all + +all: scene commit + +scene: $(FILES) + gcc $(CFLAGS) -o $(EXENAME) $(FILES) $(LIBS) + +commit: $(FILES) + git commit -a --allow-empty-message --message="" --untracked-files=no; true + +clean: + rm scene +