The-Powder-Toy/Makefile

62 lines
2.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/
OFLAGS := -fkeep-inline-functions
2012-01-08 11:39:03 -06:00
CPPC := g++
2012-01-27 07:41:35 -06:00
CPPC_WIN := g++
WIN_RES := windres
2012-01-08 11:39:03 -06:00
2012-01-20 16:07:49 -06:00
all: build/powder
powder-release.exe: build/powder-release.exe
powder.exe: build/powder.exe
powder-release: build/powder-release
2012-01-20 16:07:49 -06:00
powder: build/powder
2012-04-16 07:58:20 -05:00
build/powder-release.exe: CFLAGS += -DWIN32 -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations -pipe -msse -msse2 -msse3 -mmmx
build/powder-release.exe: LFLAGS := -lmingw32 -lregex -lws2_32 -lSDLmain -lpthread -lSDL -lm -lbz2 -llua -lfftw3f-3 -mwindows
build/powder.exe: CFLAGS += -DWIN32
build/powder.exe: LFLAGS := -lmingw32 -lregex -lws2_32 -lSDLmain -lpthread -lSDL -lm -lbz2 -llua -lfftw3f-3 #-mwindows
build/powder-release: CFLAGS += -DLIN32 -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations -pipe -msse -msse2 -msse3 -mmmx
2012-04-16 07:58:20 -05:00
build/powder-release: LFLAGS := -lSDL -lm -lbz2 -llua -lfftw3f
2012-01-20 16:07:49 -06:00
build/powder: CFLAGS += -DLIN32
2012-04-16 07:58:20 -05:00
build/powder: LFLAGS := -lSDL -lm -lbz2 -llua -lfftw3f
CFLAGS += -DGRAVFFT -DLUACONSOLE
2012-01-20 16:07:49 -06:00
2012-01-27 07:41:35 -06:00
build/powder-release.exe: $(SOURCES) build/powder-res.o
$(CPPC_WIN) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(SOURCES) $(LFLAGS) build/powder-res.o -o $@
strip $@
2012-01-27 07:41:35 -06:00
build/powder-res.o: resources/powder-res.rc resources/powder.ico resources/document.ico
cd resources && $(WIN_RES) powder-res.rc powder-res.o
mv resources/powder-res.o build/powder-res.o
build/powder-release: $(SOURCES)
$(CPPC) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(SOURCES) $(LFLAGS) -o $@
strip $@
2012-01-17 14:46:06 -06:00
build/powder.exe: buildpaths-powder.exe $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS)) build/powder-res.o
$(CPPC_WIN) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS)) build/powder-res.o $(LFLAGS) -o $@ -ggdb
2012-01-17 14:46:06 -06:00
build/obj/powder.exe/%.o: src/%.cpp $(HEADERS)
2012-01-27 07:41:35 -06:00
$(CPPC_WIN) -c $(CFLAGS) $(OFLAGS) -o $@ $< -ggdb
2012-01-20 16:07:49 -06:00
buildpaths-powder.exe:
2012-02-12 09:32:04 -06:00
$(shell mkdir -p build/obj/powder.exe/)
$(shell mkdir -p $(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:
2012-02-12 09:32:04 -06:00
$(shell mkdir -p build/obj/powder/)
$(shell mkdir -p $(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