Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Make Makefile more useful for cross-compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
laanwj committed Oct 4, 2013
1 parent 6bda497 commit bb4751e
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
MESA_INCLUDE ?= /home/cubox/mesa/include
MESA_LIB ?= /home/cubox/mesa/lib

CC = $(GCCPREFIX)gcc
CXX = $(GCCPREFIX)g++
LD = $(GCCPREFIX)ld
AR = $(GCCPREFIX)ar

INCDIR=-g -O -I./Common -I${MESA_INCLUDE} -DMESA_EGL_NO_X11_HEADERS
LIBS=-L${MESA_LIB} -lGLESv2 -lEGL -lm

Expand Down Expand Up @@ -46,31 +51,31 @@ clean:
find . -name "CH??_*" | xargs rm -f

./Hello_Triangle/CH02_HelloTriangle: ${COMMONSRC} ${COMMONHDR} ${CH02SRC}
gcc ${COMMONSRC} ${CH02SRC} -o $@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH02SRC} -o $@ ${INCDIR} ${LIBS}
./Simple_VertexShader/CH08_SimpleVertexShader: ${COMMONSRC} ${COMMONHDR} ${CH08SRC}
gcc ${COMMONSRC} ${CH08SRC} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH08SRC} -o ./$@ ${INCDIR} ${LIBS}
./Simple_Texture2D/CH09_SimpleTexture2D: ${COMMONSRC} ${COMMONHDR} ${CH09SRC1}
gcc ${COMMONSRC} ${CH09SRC1} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH09SRC1} -o ./$@ ${INCDIR} ${LIBS}
./MipMap2D/CH09_MipMap2D: ${COMMONSRC} ${COMMONHDR} ${CH09SRC2}
gcc ${COMMONSRC} ${CH09SRC2} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH09SRC2} -o ./$@ ${INCDIR} ${LIBS}
./Simple_TextureCubemap/CH09_TextureCubemap: ${COMMONSRC} ${COMMONHDR} ${CH09SRC3}
gcc ${COMMONSRC} ${CH09SRC3} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH09SRC3} -o ./$@ ${INCDIR} ${LIBS}
./TextureWrap/CH09_TextureWrap: ${COMMONSRC} ${COMMONHDR} ${CH09SRC4}
gcc ${COMMONSRC} ${CH09SRC4} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH09SRC4} -o ./$@ ${INCDIR} ${LIBS}
./MultiTexture/CH10_MultiTexture: ${COMMONSRC} ${COMMONHDR} ${CH10SRC}
gcc ${COMMONSRC} ${CH10SRC} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH10SRC} -o ./$@ ${INCDIR} ${LIBS}
./Multisample/CH11_Multisample: ${COMMONSRC} ${COMMONHDR} ${CH11SRC}
gcc ${COMMONSRC} ${CH11SRC} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH11SRC} -o ./$@ ${INCDIR} ${LIBS}
./Stencil_Test/CH11_Stencil_Test: ${COMMONSRC} ${COMMONHDR} ${CH11SRC2}
gcc ${COMMONSRC} ${CH11SRC2} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH11SRC2} -o ./$@ ${INCDIR} ${LIBS}
./Noise3D/CH13_Noise3D: ${COMMONSRC} ${COMMONHDR} ${CH13SRC1}
gcc ${COMMONSRC} ${CH13SRC1} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH13SRC1} -o ./$@ ${INCDIR} ${LIBS}
./ParticleSystem/CH13_ParticleSystem: ${COMMONSRC} ${COMMONHDR} ${CH13SRC2}
gcc ${COMMONSRC} ${CH13SRC2} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CH13SRC2} -o ./$@ ${INCDIR} ${LIBS}
./Cube/cube: ${COMMONSRC} ${COMMONHDR} ${CUBESRC}
gcc ${COMMONSRC} ${CUBESRC} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CUBESRC} -o ./$@ ${INCDIR} ${LIBS}
./CubeVBO/cube_vbo: ${COMMONSRC} ${COMMONHDR} ${CUBEVBOSRC}
gcc ${COMMONSRC} ${CUBEVBOSRC} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${CUBEVBOSRC} -o ./$@ ${INCDIR} ${LIBS}
./Viewports/viewports: ${COMMONSRC} ${COMMONHDR} ${VIEWPORTSSRC}
gcc ${COMMONSRC} ${VIEWPORTSSRC} -o ./$@ ${INCDIR} ${LIBS}
${CC} ${COMMONSRC} ${VIEWPORTSSRC} -o ./$@ ${INCDIR} ${LIBS}

0 comments on commit bb4751e

Please sign in to comment.