The-Powder-Toy/Makefile

36 lines
1.0 KiB
Makefile
Raw Normal View History

2012-01-17 14:46:06 -06:00
HEADERS := $(wildcard src/*.h) $(wildcard src/*/*.h)
2012-01-08 11:39:03 -06:00
2012-01-17 14:46:06 -06:00
SOURCES := $(wildcard src/*.cpp) $(wildcard src/*/*.cpp)
OBJS += $(patsubst src/%.cpp,build/obj/powder.exe/%.o,$(SOURCES))
2012-01-08 11:39:03 -06:00
2012-01-17 14:46:06 -06:00
FOLDERS := $(sort $(dir $(OBJS)))
2012-01-08 11:39:03 -06:00
2012-01-17 14:46:06 -06:00
CFLAGS := -Wno-deprecated -Wno-deprecated-declarations -Isrc/ -Idata/ -DWIN32 -DWINCONSOLE
OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations -msse2 -fkeep-inline-functions
2012-01-08 11:39:03 -06:00
LFLAGS := -lmingw32 -lregex -lws2_32 -lSDLmain -lpthread -lSDL -lm -lbz2 # -mwindows
CFLAGS += $(OFLAGS)
CPPC := g++
CPPC_WIN := i686-w64-mingw32-gcc
WIN_RES := i686-w64-mingw32-windres
all: build/powder.exe
powder.exe: build/powder.exe
2012-01-17 14:46:06 -06:00
build/powder.exe: buildpaths $(OBJS)
echo $(OBJS)
$(CPPC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LFLAGS) -o $@ -ggdb
build/obj/powder.exe/%.o: src/%.cpp $(HEADERS)
2012-01-08 11:39:03 -06:00
$(CPPC) -c $(CFLAGS) -o $@ $< -ggdb
2012-01-17 14:46:06 -06:00
buildpaths:
$(shell mkdir build/obj/powder.exe/)
$(shell mkdir $(FOLDERS))
2012-01-08 11:39:03 -06:00
clean:
rm build/obj/core/*.o
rm build/obj/ui/*.o
rm build/obj/elements/*.o
rm build/obj/*.o
rm build/*.exe