1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
--- 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
|