switch to waf build system
This commit is contained in:
parent
188427b99d
commit
7ee6efe574
4
.gitignore
vendored
4
.gitignore
vendored
@ -1 +1,3 @@
|
||||
/sdl-game-controller
|
||||
/build/
|
||||
/.waf*
|
||||
/.lock-waf*
|
||||
|
1251
GL3/gl3w.c
Normal file
1251
GL3/gl3w.c
Normal file
File diff suppressed because it is too large
Load Diff
1146
GL3/gl3w.h
Normal file
1146
GL3/gl3w.h
Normal file
File diff suppressed because it is too large
Load Diff
28
Makefile
28
Makefile
@ -1,21 +1,11 @@
|
||||
FILE := sdl-game-controller
|
||||
TARGET := $(FILE)
|
||||
|
||||
CFLAGS := $(shell pkg-config --cflags sdl2)
|
||||
ifeq (MINGW,$(findstring MINGW,$(shell uname)))
|
||||
LIBS := -lopengl32 -lglu32 -lmingw32
|
||||
CC := mingw32-gcc
|
||||
TARGET := $(TARGET).exe
|
||||
else
|
||||
LIBS := -lGL -lGLU `pkg-config --libs sdl2`
|
||||
endif
|
||||
LDFLAGS := $(LIBS) $(shell pkg-config --libs sdl2)
|
||||
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(FILE).c
|
||||
$(CC) -o $(TARGET) $(CFLAGS) $< $(LDFLAGS)
|
||||
.PHONY: build
|
||||
build:
|
||||
./waf build
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(TARGET) *~ *.o
|
||||
./waf clean
|
||||
|
||||
.PHONY: distclean
|
||||
distclean:
|
||||
./waf distclean
|
||||
|
170
waf
vendored
Executable file
170
waf
vendored
Executable file
File diff suppressed because one or more lines are too long
38
wscript
Normal file
38
wscript
Normal file
@ -0,0 +1,38 @@
|
||||
import os
|
||||
|
||||
def options(opt):
|
||||
opt.load("compiler_c compiler_cxx")
|
||||
|
||||
def configure(conf):
|
||||
conf.load("compiler_c compiler_cxx")
|
||||
conf.env.INCLUDES += ["glcxx/include"]
|
||||
conf.env.INCLUDES += ["."]
|
||||
conf.env.DEFINES += ['''GLCXX_GL_INCLUDE="GL3/gl3w.h"''']
|
||||
conf.env.CXXFLAGS += ["-Wall"]
|
||||
conf.env.CXXFLAGS += ["-std=gnu++14"]
|
||||
conf.check_cfg(package = "sdl2", args = "--cflags --libs")
|
||||
if "MINGW" in os.popen("uname").read():
|
||||
# TODO: set CXX to mingw32-g++
|
||||
pass
|
||||
if os.listdir("glcxx") == []:
|
||||
print("Fetching git submodules...")
|
||||
from subprocess import Popen
|
||||
Popen(["git", "submodule", "update", "--init"]).wait()
|
||||
|
||||
def build(bld):
|
||||
sources = ["sdl-game-controller.cc"] + \
|
||||
bld.path.ant_glob("glcxx/src/**/*.cpp") + \
|
||||
bld.path.ant_glob("GL3/**/*.c")
|
||||
|
||||
libs = []
|
||||
if "MINGW" in os.popen("uname").read():
|
||||
libs += ["opengl32", "mingw32"]
|
||||
else:
|
||||
libs += ["dl", "GL"]
|
||||
bld.program(
|
||||
source = sources,
|
||||
target = "sdl-game-controller",
|
||||
uselib = "SDL2",
|
||||
lib = libs,
|
||||
linkflags = ["-Wl,-rpath,$ORIGIN"],
|
||||
install_path = None)
|
Loading…
x
Reference in New Issue
Block a user