librw/Makefile.ps2

34 lines
979 B
Makefile
Raw Normal View History

CXX=ee-g++
# null, opengl
BUILD=ps2
# e.g. null -> -DRW_NULL
BUILDDEF:=$(shell echo $(BUILD) | tr a-z A-Z | sed 's/^/-DRW_/')
BUILDDIR=build-$(BUILD)
SRCDIR=src
SRC := $(patsubst %.cpp,$(SRCDIR)/%.cpp, rwbase.cpp clump.cpp\
2015-01-17 14:15:03 +00:00
geometry.cpp plugins.cpp\
ps2.cpp ogl.cpp\
image.cpp gtaplg.cpp)
OBJ := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$(SRC))
DEP := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.d,$(SRC))
CFLAGS=-Wall -g $(BUILDDEF) #-Wno-parentheses #-Wconversion
2014-12-28 11:06:19 +00:00
INCPATH=-I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include
LIB=librw-$(BUILD).a
$(LIB): $(OBJ)
ar scr $@ $(OBJ)
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
2015-01-18 18:35:23 +00:00
@mkdir -p $(@D)
2014-12-28 11:06:19 +00:00
$(CXX) $(CFLAGS) $(INCPATH) -c $< -o $@
$(BUILDDIR)/%.d: $(SRCDIR)/%.cpp
2015-01-18 18:35:23 +00:00
@mkdir -p $(@D)
$(CXX) -MM -MT '$(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$<)' $(CFLAGS) $< > $@
clean:
rm -f $(BUILDDIR)/*.[od]
-include $(DEP)