X-Git-Url: https://git.ralfj.de/gltest.git/blobdiff_plain/46e0af78b821979029c3db50e353192384583f23..520f5e8cbcbbe69da6fa878fac2200f7bf302d68:/Makefile?ds=sidebyside diff --git a/Makefile b/Makefile index c07c0fc..39c6780 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,35 @@ -FLAGS := -Wall +CFLAGS := -Wall -g -O1 COMMON_SRC = gltest.cpp glwindow.cpp -COMMON_HDR = glwindow.h +COMMON_HDR = glwindow.h glutil.h +COMMON_LD = -lX11 -lboost_program_options -all: glxtest egltest eglinfo +BINARIES := glxtest egltest glx2test egl2test gles2test eglinfo -glxtest: $(COMMON_SRC) $(COMMON_HDR) glxbackend.cpp glxbackend.h - g++ $(FLAGS) -DUSE_GLX $(COMMON_SRC) glxbackend.cpp -lGL -lX11 -lboost_program_options -o glxtest +all: $(BINARIES) -egltest: $(COMMON_SRC) $(COMMON_HDR) eglbackend.cpp eglbackend.h - g++ $(FLAGS) -DUSE_EGL $(COMMON_SRC) eglbackend.cpp -lEGL -lGL -lX11 -lboost_program_options -o egltest +# choices (not all combinations are valid) +# windowing system: WIN_{GLX,EGL} +# the kind of context: CON_{GL1,GLES2} +# the API used to draw: compile in glutil_gl1.cpp or glutil_gl2.cpp + +glxtest: $(COMMON_SRC) $(COMMON_HDR) glutil_gl1.cpp glxbackend.cpp glxbackend.h + g++ $(CFLAGS) -DWIN_GLX -DCON_GL1 $^ -lGL $(COMMON_LD) -o $@ + +egltest: $(COMMON_SRC) $(COMMON_HDR) glutil_gl1.cpp eglbackend.cpp eglbackend.h + g++ $(CFLAGS) -DWIN_EGL -DCON_GL1 $^ -lEGL -lGL $(COMMON_LD) -o $@ + +glx2test: $(COMMON_SRC) $(COMMON_HDR) glutil_gl2.cpp glxbackend.cpp glxbackend.h + g++ $(CFLAGS) -DWIN_GLX -DCON_GL1 $^ -lGL $(COMMON_LD) -o $@ + +egl2test: $(COMMON_SRC) $(COMMON_HDR) glutil_gl2.cpp eglbackend.cpp eglbackend.h + g++ $(CFLAGS) -DWIN_EGL -DCON_GL1 $^ -lEGL -lGL $(COMMON_LD) -o $@ + +gles2test: $(COMMON_SRC) $(COMMON_HDR) glutil_gl2.cpp eglbackend.cpp eglbackend.h + g++ $(CFLAGS) -DWIN_EGL -DCON_GLES2 $^ -lEGL -lGLESv2 $(COMMON_LD) -o $@ eglinfo: eglinfo.c - gcc $(FLAGS) eglinfo.c -lEGL -lGL -lX11 -o eglinfo + gcc $(CFLAGS) $^ -lEGL -lGL -lX11 -o $@ clean: - rm -f glxtest egltest eglinfo + rm -f $(BINARIES)