Some c++ testing

This commit is contained in:
Gulum
2017-10-23 18:52:24 +02:00
parent 9676c44ef2
commit 9130a45795
7 changed files with 55 additions and 56 deletions

View File

@@ -7,9 +7,10 @@ LIBS = -lmingw32 -lSDL2main -lSDL2 -lbox2d -lentityx
SRCDIR = src
BUILDDIR = build
SRC = $(shell C:\\MinGW\\msys\\1.0\\bin\\find $(SRCDIR) -name *.cpp)
OBJ = $(patsubst %.cpp, %.o, $(SRC))
OBJ := $(subst $(SRCDIR), $(BUILDDIR), $(OBJ))
SRCDIRS := $(shell C:\\MinGW\\msys\\1.0\\bin\\find src/**/* -name '*.cpp' -exec dirname {} \; | sort | uniq)
BUILDLIST := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SRCDIRS))
SRC = $(shell C:\\MinGW\\msys\\1.0\\bin\\find $(SRCDIR) -type f -name *.cpp)
OBJ := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SRC:.cpp=.o))
.PHONY: all clean build run debug
@@ -19,9 +20,10 @@ run: all
$(BUILDDIR)/$(EXE)
$(EXE): $(OBJ)
$(CC) $(CFLAGS) -o $(BUILDDIR)/$@ $(OBJ) -L$(LIB_PATH) $(LIBS) -static-libgcc -static-libstdc++
$(CC) $(CFLAGS) -o $(BUILDDIR)/$@ $^ -L$(LIB_PATH) $(LIBS) -static-libgcc -static-libstdc++
$(OBJ): $(SRC)
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(BUILDLIST)
$(CC) $(CFLAGS) -c $< -o $@ -I$(INC_PATH)
build:
@@ -34,4 +36,4 @@ clean:
rm -rf $(BUILDDIR)
debug:
@echo $(OBJ)
@echo $(BUILDLIST)