# Die folgenden 2 Zeilen sind unter Linux schon vordefiniert,
# andere Systeme brauchen diese Definitionen eventuell?
CC=gcc
CXX=g++

#WARN = -Wall #so fuer neue Programme
# nach -Wall koennen noch Ausnahmen geschaltet werden:
WARN = -Wall -Wno-unused-variable -Wno-unused-result -Wno-write-strings
#WARN = -Wall -Wno-unused-variable -Wno-unused-result -Wno-write-strings -Wno-parentheses

#DEBUG= -ggdb -D _DEBUG # ggdb fuer den Gnu-Debugger, _DEBUG fuer im Programm
OPT  = -O3  #-O3 fuer moeglichst schnell, -Os fuer moeglist kurz
#CFLAGS  = -pthread -std=c++11 -I$h $(WARN) $(OPT) $(DEBUG) 
CFLAGS  =  -std=c++11 $(WARN) $(OPT) $(DEBUG) 
CXXFLAGS= $(CFLAGS)

# fuer xtekplot:
#LDFLAGS = -L/usr/X11R6/lib $(DEBUG)
#MYLIBS  = $h/xtekplot1.o 
#LDLIBS  = -lm -lX11

# fuer OpenGL:
LDFLAGS = $(DEBUG)
LDLIBS  = -lGL -lSDL2 -lGLEW -lm
MYLIBS = otekplot1.h fonts/myfonts.cc #nachfilenamefragen.h

#all: getGLversion main
all: main

main: main.cpp showitlight.cc $(MYLIBS)
getGLversion: getGLversion.cc

install:
	cp main $(HOME)/bin/openglshowitlight

paket:
	tar zcvf ../OpenGLShowitlight.tar.gz ../OpenGLShowitlight

wincopy:
	cp -p otekplot1.h ../win/OpenGLShowitlight/
	cp -p nachfilenamefragen.h ../win/OpenGLShowitlight/
	cp -p main.cpp ../win/OpenGLShowitlight/
	cp -p fonts/*.* ../win/OpenGLShowitlight/fonts/
	cp -p showitlight.h ../win/OpenGLShowitlight/
	cp -p showitlight.cc ../win/OpenGLShowitlight/
winpaket:
	rm -f ../win/OpenGLShowitlight.7z
	7z a ../win/OpenGLShowitlight.7z ../win/OpenGLShowitlight

clean:
	rm -f *.o *~
clean_all:
	rm -f *.o *~
	rm -f main getGLversion
