Skip to content

Instantly share code, notes, and snippets.

@rsdy
Created September 11, 2011 22:54
Show Gist options
  • Save rsdy/1210235 to your computer and use it in GitHub Desktop.
Save rsdy/1210235 to your computer and use it in GitHub Desktop.
grafika makefile
# usage:
# to build hazi1.cpp: make hazi1
# to build and run: make RUN=1 hazi1
# to build and strip //-style comments: make STRIP=1 hazi1
# guess what: make RUN=1 STRIP=1 hazi1
CC = g++
OPTS = -g --pedantic -Wall --ansi -lglut
.cpp:
$(CC) $(OPTS) $*.cpp -o $*
ifdef RUN
./$*
endif
ifdef STRIP
echo -e '\n\n------------------------------\n----------- SOURCE -----------\n------------------------------'
cat $*.cpp |sed '/^\s*\/\/.*$$/d' |sed 's;//.*$$;;'
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment