librw/Makefile.mingw

33 lines
982 B
Makefile
Raw Normal View History

2014-12-24 13:32:39 +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-24 10:59:17 +00:00
SRCDIR=src
2016-01-26 12:53:08 +00:00
#SRC := $(patsubst %.cpp,$(SRCDIR)/%.cpp, rwbase.cpp clump.cpp\
# geometry.cpp plugins.cpp pipeline.cpp\
# ps2.cpp ogl.cpp xbox.cpp\
# image.cpp gtaplg.cpp)
SRC := $(wildcard $(SRCDIR)/*.cpp)
2014-12-24 10:59:17 +00:00
OBJ := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$(SRC))
DEP := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.d,$(SRC))
CFLAGS=-Wall -Wextra -g -DGLEW_STATIC $(BUILDDEF) -Wno-parentheses #-Wconversion
2014-12-24 13:32:39 +00:00
LIB=librw-$(BUILD).a
2014-12-24 10:59:17 +00:00
2014-12-24 13:32:39 +00:00
$(LIB): $(OBJ)
2014-12-24 10:59:17 +00:00
ar scr $@ $(OBJ)
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
2015-01-18 18:35:23 +00:00
@mkdir -p $(@D)
2014-12-24 10:59:17 +00:00
$(CXX) $(CFLAGS) -c $< -o $@
$(BUILDDIR)/%.d: $(SRCDIR)/%.cpp
2015-01-18 18:35:23 +00:00
@mkdir -p $(@D)
2014-12-24 10:59:17 +00:00
$(CXX) -MM -MT '$(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$<)' $(CFLAGS) $< > $@
2014-12-24 13:32:39 +00:00
clean:
rm -f $(BUILDDIR)/*.[od]
2014-12-24 10:59:17 +00:00
-include $(DEP)