53 lines
2.1 KiB
Makefile
53 lines
2.1 KiB
Makefile
CXX=g++
|
|
CXXOPTS=-Og -ggdb -fvar-tracking-assignments -Wall -Winvalid-pch -Wextra -Wno-unused-function -pedantic -std=c++14 -march=native -fstack-protector-strong --param=ssp-buffer-size=4 -flto -Isrc -pthread
|
|
LDOPTS=-Wl,--sort-common
|
|
|
|
render_CXXSRCS ::= render/Renderer.cc render/GlResource.cc render/ProgramProvider.cc render/renderutil.cc render/Overlay.cc render/VBOManager.cc render/Object.cc render/AlResource.cc render/AudioStream.cc
|
|
render_LIBS ::= -lSDL2 -lSDL2_ttf -lglbinding -lopenal
|
|
game_CXXSRCS ::= game/GSMvePlay.cc game/GSShowObject.cc
|
|
|
|
|
|
iffexplore_CXXSRCS ::= iffexplore.cc IffFile.cc util.cc exceptions.cc ResourceProvider.cc TreFile.cc decompress.cc
|
|
iffexplore_LIBS ::=
|
|
|
|
treexplore_CXXSRCS ::= treexplore.cc TreFile.cc IffFile.cc util.cc exceptions.cc decompress.cc ResourceProvider.cc
|
|
treexplore_LIBS ::=
|
|
|
|
font2png_CXXSRCS ::= font2png.cc
|
|
font2png_LIBS ::= -lpng
|
|
|
|
mvedecode_CXXSRCS ::= mvedecode.cc TreFile.cc IffFile.cc util.cc MveDecoder.cc exceptions.cc decompress.cc ResourceProvider.cc $(render_CXXSRCS) $(game_CXXSRCS)
|
|
mvedecode_LIBS ::= $(render_LIBS)
|
|
|
|
objdecode_CXXSRCS ::= objdecode.cc TreFile.cc IffFile.cc util.cc ObjDecoder.cc exceptions.cc decompress.cc PaletteDecoder.cc ResourceProvider.cc $(render_CXXSRCS) $(game_CXXSRCS)
|
|
objdecode_LIBS ::= $(render_LIBS)
|
|
|
|
shapdecode_CXXSRCS ::= shapdecode.cc exceptions.cc util.cc ShapDecoder.cc IffFile.cc ResourceProvider.cc TreFile.cc decompress.cc
|
|
shapdecode_LIBS ::=
|
|
|
|
progs ::= iffexplore treexplore mvedecode objdecode shapdecode
|
|
|
|
all: $(progs)
|
|
|
|
objs/%.o: src/%.cc src/common.hh.gch
|
|
$(CXX) $(CXXOPTS) -c -MMD -MP -o $@ $<
|
|
@cp objs/$*.d objs/$*.P; rm -f objs/$*.d
|
|
|
|
src/common.hh.gch: src/common.hh src/compiler.hh src/platform.hh src/exceptions.hh
|
|
$(CXX) $(CXXOPTS) -c -o $@ $<
|
|
|
|
$(progs): %:
|
|
$(CXX) $(CXXOPTS) $(LDOPTS) -o $@ $^ $($(@)_LIBS)
|
|
|
|
clean:
|
|
rm -f $(progs)\
|
|
$(foreach prog,$(progs),$(addprefix objs/,$($(prog)_CXXSRCS:.cc=.o)))\
|
|
$(foreach prog,$(progs),$(addprefix objs/,$($(prog)_CXXSRCS:.cc=.P)))
|
|
|
|
.PHONY: clean all
|
|
|
|
-include $(foreach prog,$(progs),$(addprefix objs/,$($(prog)_CXXSRCS:.cc=.P)))
|
|
|
|
.SECONDEXPANSION:
|
|
$(progs): %: $$(addprefix objs/,$$($$@_CXXSRCS:.cc=.o))
|