The-Powder-Toy/Makefile

46 lines
1.6 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)
2012-01-20 16:07:49 -06:00
OBJS := $(patsubst src/%.cpp,build/obj/%.o,$(SOURCES))
2012-01-08 11:39:03 -06:00
2012-01-20 16:07:49 -06:00
FOLDERS :=
2012-01-08 11:39:03 -06:00
2012-01-20 16:07:49 -06:00
CFLAGS := -w -Isrc/ -Idata/
2012-01-23 04:50:48 -06:00
OFLAGS := -fkeep-inline-functions -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations -msse2
2012-01-08 11:39:03 -06:00
CPPC := g++
CPPC_WIN := i686-w64-mingw32-gcc
WIN_RES := i686-w64-mingw32-windres
2012-01-20 16:07:49 -06:00
all: build/powder
powder.exe: build/powder.exe
2012-01-20 16:07:49 -06:00
powder: build/powder
build/powder.exe: CFLAGS += -DWIN32 -DWINCONSOLE
build/powder.exe: LFLAGS := -lmingw32 -lregex -lws2_32 -lSDLmain -lpthread -lSDL -lm -lbz2 #-mwindows
build/powder: CFLAGS += -DLIN32
build/powder: LFLAGS := -lSDL -lm -lbz2
2012-01-17 14:46:06 -06:00
2012-01-20 16:07:49 -06:00
build/powder.exe: buildpaths-powder.exe $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS))
$(CPPC) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS)) $(LFLAGS) -o $@ -ggdb
2012-01-17 14:46:06 -06:00
build/obj/powder.exe/%.o: src/%.cpp $(HEADERS)
2012-01-20 16:07:49 -06:00
$(CPPC) -c $(CFLAGS) $(OFLAGS) -o $@ $< -ggdb
buildpaths-powder.exe:
2012-01-17 14:46:06 -06:00
$(shell mkdir build/obj/powder.exe/)
$(shell mkdir $(sort $(dir $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS)))))
2012-01-20 16:07:49 -06:00
build/powder: buildpaths-powder $(patsubst build/obj/%.o,build/obj/powder/%.o,$(OBJS))
$(CPPC) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(patsubst build/obj/%.o,build/obj/powder/%.o,$(OBJS)) $(LFLAGS) -o $@ -ggdb
build/obj/powder/%.o: src/%.cpp $(HEADERS)
$(CPPC) -c $(CFLAGS) $(OFLAGS) -o $@ $< -ggdb
buildpaths-powder:
$(shell mkdir build/obj/powder/)
$(shell mkdir $(sort $(dir $(patsubst build/obj/%.o,build/obj/powder/%.o,$(OBJS)))))
2012-01-08 11:39:03 -06:00
clean:
2012-01-20 16:07:49 -06:00
rm -r build/obj/*
rm build/*.exe