was müsste ich am makefile ändern wenn ...



  • damit würde ich den code übersetzen

    g++ -L/usr/lib -lSDL -lGL -lGLU -I/usr/include/GL -I/usr/include/SDL -ansi -w -O3 main.cpp Camera.cpp Display.cpp Char/Character.cpp Char/D20Class.cpp 
    Char/D20ClassInstance.cpp Char/Race.cpp Level/CreatureInstance.cpp Level/Level.cpp ModelInterface/StaticModel.cpp ModelInterface/WaveformModel.cpp
    

    aber irgendwie weis ich nicht so genau wie ich das forenmakefile an die includes die offensichtlich noch fehlen anpasse:

    TARGET   := ./prog
    CXXFLAGS := -march=nocona -O2 -pipe -fomit-frame-pointer -s -mfpmath=sse -msse2 -mmmx
    CXX      := g++
    # für Linux liegen die diese Libs in /usr/libs
    LIBS     := -L/usr/lib -lSDL -lGL -lGLU 
    EXT      := cpp
    BUILDDIR := build
    
    override BUILDDIR := $(strip $(BUILDDIR))
    SOURCES  := $(wildcard *.$(EXT))
    OBJECTS  := $(patsubst %.$(EXT), $(BUILDDIR)/%.o, $(SOURCES))
    DEPS     := $(patsubst %.$(EXT), $(BUILDDIR)/%.dep, $(SOURCES))
    
    .PHONY: all
    all: $(TARGET)
    
    $(TARGET): $(OBJECTS) $(DEPS)
    	$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
    
    ifneq ($(MAKECMDGOALS), clean)
    -include $(DEPS)
    endif
    
    $(OBJECTS): $(BUILDDIR)/%.o: %.$(EXT) $(BUILDDIR)/%.dep $(BUILDDIR)/.tag
    	$(CXX) $(CXXFLAGS) -c $< -o $@
    
    $(DEPS): $(BUILDDIR)/%.dep: %.$(EXT) $(BUILDDIR)/.tag
    	$(CXX) $(CXXFLAGS) -MM $< -MT $@ -MT $(<:.$(EXT)=.o) -o $@
    
    %.tag:
    	mkdir -p $(dir $(@))
    	touch $@
    
    .PHONY: clean
    clean:
    	rm -rf $(BUILDDIR)
    


  • das hier klappt zb nicht ):

    TARGET   := ./prog
    CXXFLAGS := -march=nocona -O2 -pipe -fomit-frame-pointer -s -mfpmath=sse -msse2 -mmmx
    CXX      := g++
    # für Linux liegen die diese Libs in /usr/libs
    LIBS     := -L/usr/lib -lSDL -lGL -lGLU 
    INCLUDES := -I/usr/include/GL -I/usr/include/SDL
    EXT      := cpp
    BUILDDIR := build
    
    override BUILDDIR := $(strip $(BUILDDIR))
    SOURCES  := $(wildcard *.$(EXT))
    OBJECTS  := $(patsubst %.$(EXT), $(BUILDDIR)/%.o, $(SOURCES))
    DEPS     := $(patsubst %.$(EXT), $(BUILDDIR)/%.dep, $(SOURCES))
    
    .PHONY: all
    all: $(TARGET)
    
    $(TARGET): $(OBJECTS) $(DEPS)
    	$(CXX) $(INCLUDES) $(CXXFLAGS) -o $(TARGET) $(OBJECTS) $(INCLUDES) $(LIBS)
    
    ifneq ($(MAKECMDGOALS), clean)
    -include $(DEPS)
    endif
    
    $(OBJECTS): $(BUILDDIR)/%.o: %.$(EXT) $(BUILDDIR)/%.dep $(BUILDDIR)/.tag
    	$(CXX) $(INCLUDES) $(CXXFLAGS) -c $< -o $@
    
    $(DEPS): $(BUILDDIR)/%.dep: %.$(EXT) $(BUILDDIR)/.tag
    	$(CXX) $(INCLUDES) $(CXXFLAGS) -MM $< -MT $@ -MT $(<:.$(EXT)=.o) -o $@
    
    %.tag:
    	mkdir -p $(dir $(@))
    	touch $@
    
    .PHONY: clean
    clean:
    	rm -rf $(BUILDDIR)
    

Log in to reply