2014-12-24 13:04:46 +00:00
|
|
|
# null, opengl
|
|
|
|
BUILD=null
|
|
|
|
|
|
|
|
# e.g. null -> -DRW_NULL
|
|
|
|
BUILDDEF:=$(shell echo $(BUILD) | tr a-z A-Z | sed 's/^/-DRW_/')
|
|
|
|
BUILDDIR=build-$(BUILD)
|
2014-12-23 14:59:14 +00:00
|
|
|
SRCDIR=src
|
|
|
|
SRC := $(patsubst %.cpp,$(SRCDIR)/%.cpp, rwbase.cpp clump.cpp\
|
|
|
|
geometry.cpp plugins.cpp ps2.cpp\
|
|
|
|
ogl.cpp)
|
|
|
|
OBJ := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$(SRC))
|
2014-12-24 10:38:25 +00:00
|
|
|
DEP := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.d,$(SRC))
|
2014-12-24 13:04:46 +00:00
|
|
|
CFLAGS=-Wall -Wextra -g $(BUILDDEF) #-Wno-parentheses #-Wconversion
|
|
|
|
LIB=librw-$(BUILD).a
|
2014-12-23 14:59:14 +00:00
|
|
|
|
2014-12-24 13:04:46 +00:00
|
|
|
$(LIB): $(OBJ)
|
2014-12-23 14:59:14 +00:00
|
|
|
ar scr $@ $(OBJ)
|
|
|
|
|
|
|
|
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
|
|
|
|
$(CXX) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(BUILDDIR)/%.d: $(SRCDIR)/%.cpp
|
|
|
|
$(CXX) -MM -MT '$(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$<)' $(CFLAGS) $< > $@
|
|
|
|
|
2014-12-24 13:04:46 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(BUILDDIR)/*.[od]
|
|
|
|
|
2014-12-23 14:59:14 +00:00
|
|
|
-include $(DEP)
|