shithub: tinygl

Download patch

ref: ead5b68d2e48ca6166ae65100fd38ea67bb18910
parent: 138a63d0ad59c454edf25ebb7903aabfa331f9c4
author: David <gek@katherine>
date: Sun Feb 14 09:43:09 EST 2021

Now it compiles into a lib directory

--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,19 @@
 
+LIB = lib/libTinyGL.a
 
-all: src SDL_Examples
+all: $(LIB) SDL_Examples
 	@echo Done!
 
-src:
+$(LIB):
 	cd src && $(MAKE) && cd ..
 
 
-SDL_Examples:
+SDL_Examples: $(LIB)
 	cd SDL_Examples && $(MAKE) && cd ..
 clean:
 	cd src && $(MAKE) clean && cd ..
 	cd SDL_Examples && $(MAKE) clean && cd ..
+	cd lib && rm -f *.a && cd ..
 #clean:
 #	rm -f *~ *.o *.a
 #	cd SDL_Examples && $(MAKE) clean && cd ..
--- a/SDL_Examples/Makefile
+++ b/SDL_Examples/Makefile
@@ -3,12 +3,13 @@
 GL_LIBS= -L../ 
 GL_INCLUDES= -I../include/
 ALL_T= gears texture model
+LIB= ../lib/libTinyGL.a
 all: $(ALL_T)
 clean:
 	rm -f $(ALL_T)
 texture:
-	gcc texture.c ../src/libTinyGL.a -o texture $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
+	gcc texture.c $(LIB) -o texture $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
 model:
-	gcc model.c ../src/libTinyGL.a -o model $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
+	gcc model.c $(LIB) -o model $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
 gears:
-	gcc gears.c ../src/libTinyGL.a -o gears $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
+	gcc gears.c $(LIB) -o gears $(GL_INCLUDES) $(GL_LIBS) $(CFLAGS) -lSDL -lSDL_mixer -lmad -logg -lmikmod -logg -lm
--- a/src/Makefile
+++ b/src/Makefile
@@ -16,6 +16,7 @@
 LIB = libTinyGL.a
 
 all: $(LIB)
+	mv $(LIB) ../lib/
 
 $(LIB): $(OBJS)
 	rm -f $(LIB)