Permalink
Browse files

Change makefile

  • Loading branch information...
1 parent a86bf1c commit c14136e7a902a62fe6b7acc6cdfc83d6c08205b7 Amos Wenger committed Dec 15, 2011
Showing with 23 additions and 15 deletions.
  1. +3 −3 .gitignore
  2. +5 −0 Makefile
  3. +14 −11 src/Makefile
  4. +1 −1 src/rgbe.c
View
@@ -1,4 +1,4 @@
+media
+bin/*
+src/objs/*
*.o
-IN55_HDR_demo
-log
-data
View
@@ -0,0 +1,5 @@
+all:
+ cd src && make
+
+clean:
+ cd src && make clean
View
@@ -1,7 +1,7 @@
# Source files
SRC = Camera.cpp Color.cpp HdrApp.cpp Image.cpp ImageManager.cpp main.cpp ZMath.cpp Matrix4.cpp MemoryManager.cpp OpenGLApp.cpp OpenGLFBO.cpp OpenGLRenderer.cpp OpenGLShader.cpp OpenGLTextureCube.cpp TriMesh.cpp TriMeshManager.cpp Vector3.cpp File.cpp DownSampler.cpp OpenGLFont.cpp OpenGLTexture2D.cpp
-OBJ = $(SRC:.cpp=.o)
-OUT = IN55_HDR_demo
+OBJ = $(SRC:%.cpp=objs/%.o)
+OUT = ../bin/envmap2
# Include
INCLUDES = -I. `sdl-config --cflags`
@@ -20,20 +20,23 @@ CXXFLAGS = -O0 -g -W -Wall -pipe
.SUFFIXES: .cpp
-default: $(OUT)
+default: prepare $(OUT)
-.cpp.o:
+prepare:
+ mkdir -p objs/ ../bin/
+
+$(OBJ): objs/%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
-GLee.o:
- $(CCC) $(CXXFLAGS) $(INCLUDES) -c GLee.c -o GLee.o
+objs/GLee.o:
+ $(CCC) $(CXXFLAGS) $(INCLUDES) -c GLee.c -o objs/GLee.o
-rgbe.c:
- $(CCC) $(CXXFLAGS) $(INCLUDES) -c rgbe.c -o rgbe.o
+objs/rgbe.o:
+ $(CCC) $(CXXFLAGS) $(INCLUDES) -c rgbe.c -o objs/rgbe.o
-$(OUT): $(OBJ) GLee.o rgbe.o
- $(CXX) $(OBJ) GLee.o rgbe.o -o $(OUT) $(LIBS)
+$(OUT): $(OBJ) objs/GLee.o objs/rgbe.o
+ $(CXX) $(OBJ) objs/GLee.o objs/rgbe.o -o $(OUT) $(LIBS)
clean:
- rm -f $(OBJ) GLee.o rgbe.o $(OUT)
+ rm -f objs/*.o $(OUT)
View
@@ -129,7 +129,7 @@ int RGBE_ReadHeader(FILE *fp, int *width, int *height, rgbe_header_info *info)
char buf[128];
int found_format;
float tempf;
- int i;
+ unsigned long i;
found_format = 0;
if (info) {

0 comments on commit c14136e

Please sign in to comment.