convert build system to waf
This commit is contained in:
1 parent
9e7c523b48
commit
d04ef0dd20
5 files changed
+223
-45
No files matched your search
@@ -1,46 +1,11 @@
|
||||
TARGET := app
|
||||
OBJS := app.o GL3/gl3w.o
|
||||
OBJS += glcxx/src/glcxx/Array.o
|
||||
OBJS += glcxx/src/glcxx/Buffer.o
|
||||
OBJS += glcxx/src/glcxx/Program.o
|
||||
OBJS += glcxx/src/glcxx/Shader.o
|
||||
OBJS += glcxx/src/glcxx/Texture.o
|
||||
REPOS := glcxx glm
|
||||
|
||||
CCFLAGS := $(shell sdl2-config --cflags)
|
||||
ifeq (MINGW,$(findstring MINGW,$(shell uname)))
|
||||
LIBS := -lopengl32 -lmingw32
|
||||
CXX := mingw32-g++
|
||||
TARGET := $(TARGET).exe
|
||||
else
|
||||
LIBS := -lGL `sdl2-config --libs`
|
||||
endif
|
||||
LIBS += -ldl
|
||||
LDFLAGS := $(LIBS) $(shell sdl2-config --libs)
|
||||
CCFLAGS += -I glcxx/include -I glm -I.
|
||||
CXXFLAGS += -std=gnu++14
|
||||
CCFLAGS += -DGLCXX_GL_INCLUDE='"GL3/gl3w.h"'
|
||||
|
||||
|
||||
all: submodule_init $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CXX) -o $(TARGET) $^ $(LDFLAGS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c -o $@ $(CCFLAGS) $(CFLAGS) $<
|
||||
|
||||
%.o: %.cc
|
||||
$(CXX) -c -o $@ $(CCFLAGS) $(CXXFLAGS) $<
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c -o $@ $(CCFLAGS) $(CXXFLAGS) $<
|
||||
|
||||
.PHONY: submodule_init
|
||||
submodule_init:
|
||||
@if [ ! -e glcxx ]; then \
|
||||
git submodule update --init; \
|
||||
fi
|
||||
.PHONY: build
|
||||
build:
|
||||
./waf build
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(TARGET) *~ $(OBJS)
|
||||
./waf clean
|
||||
|
||||
.PHONY: distclean
|
||||
distclean:
|
||||
./waf distclean
|
||||
Reference in new issue
Block a user