2014-12-27 22:18:10 +00:00
|
|
|
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-07-11 22:48:11 +01:00
|
|
|
geometry.cpp plugins.cpp pipeline.cpp\
|
2015-08-15 22:22:51 +01:00
|
|
|
ps2.cpp ogl.cpp xbox.cpp\
|
2015-01-06 22:17:05 +00:00
|
|
|
image.cpp gtaplg.cpp)
|
2014-12-27 22:18:10 +00:00
|
|
|
OBJ := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$(SRC))
|
|
|
|
DEP := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.d,$(SRC))
|
2015-08-15 22:22:51 +01:00
|
|
|
CFLAGS=-Wall -g $(BUILDDEF) -Wno-parentheses #-Wconversion
|
2014-12-28 11:06:19 +00:00
|
|
|
INCPATH=-I$(PS2SDK)/ee/include -I$(PS2SDK)/common/include
|
2014-12-27 22:18:10 +00:00
|
|
|
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 $@
|
2014-12-27 22:18:10 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/%.d: $(SRCDIR)/%.cpp
|
2015-01-18 18:35:23 +00:00
|
|
|
@mkdir -p $(@D)
|
2014-12-27 22:18:10 +00:00
|
|
|
$(CXX) -MM -MT '$(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$<)' $(CFLAGS) $< > $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(BUILDDIR)/*.[od]
|
|
|
|
|
|
|
|
-include $(DEP)
|