--- Makefile.orig 2010-02-05 19:50:30 UTC +++ Makefile @@ -2,7 +2,7 @@ # Makefile with auto-dependency generation # Add Include directories here. -INCLUDES = -I . +INCLUDES = -I . `${SDL_CONFIG} --cflags` # Automatic searching for source files. # Objects to compile are all sources (cpp) and put the .o below build-dir. @@ -20,40 +20,38 @@ ifneq (,$(findstring Win,$(OS))) LIMITER=$(dir \file) CFLAGS+= -static-libgcc else - LIBRARIES= -lGL -lGLU -lSDL -lopenal -lalut + LIBRARIES= ${LDFLAGS} -lGL -lGLU `${SDL_CONFIG} --libs` -lopenal -lalut TARGET=dist/linwarrior MKDIR=mkdir RM=rm -f RMREC=rm -f -r CP=cp - CPP=c++ + CPP=${CXX} LIMITER=/ endif # Creation of dependency information when compiling. -CFLAGS += -Wp,-M,-MP,-MT,$@,-MF,dep/$(subst /,-,$@).d # Print warnings when compiling. -CFLAGS += -Wall +CXXFLAGS += -Wall # Use the given includepathes. -CFLAGS += $(INCLUDES) +CXXFLAGS += $(INCLUDES) # Optimizations. -CFLAGS += -O1 -funroll-loops # Default makefile Target. all: $(TARGET) # For executable we need all sources compiled to objects. $(TARGET): $(OBJECTS) - $(CPP) -o $(TARGET) $(OBJECTS) $(LIBRARIES) + $(CXX) -o $(TARGET) $(OBJECTS) ${LDFLAGS} $(LIBRARIES) # Compile all Source files, creates output directories as necessary. build/%.o: %.cpp $(shell $(MKDIR) build 2>/dev/null) $(shell $(MKDIR) $(dir $@) 2>/dev/null) - $(CPP) $(CFLAGS) -c $< -o $@ + $(CXX) $(CXXFLAGS) -c $< -o $@ # IDE may call makefile with target "build" instead of "all". build: all