[clinfo] 07/55: Rewrite build system

Andreas Beckmann anbe at moszumanska.debian.org
Sat Jan 13 14:39:59 UTC 2018


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch master
in repository clinfo.

commit 1210cbef6992c2ff2d1a3770f7280ac9c13297cc
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Wed Oct 26 00:28:53 2016 +0200

    Rewrite build system
    
    This should allow building on BSD systems without requiring GNU make.
---
 GNUmakefile |  7 +++++++
 Makefile    | 40 ++++++++++++++++++++++++----------------
 2 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..8cf9072
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,7 @@
+# GNU Make specifics
+
+OS := $(shell uname -s)
+
+include Makefile
+
+
diff --git a/Makefile b/Makefile
index 88af306..b174df7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,35 @@
-SRCDIR=src
+# Headers
 
-VPATH=$(SRCDIR)
+HDR =	src/error.h \
+	src/ext.h \
+	src/fmtmacros.h \
+	src/memory.h \
+	src/ms_support.h \
+	src/strbuf.h
 
-HDR=$(wildcard $(SRCDIR)/*.h)
+VPATH = src
 
-PLATFORM=$(shell uname -s)
+CFLAGS += -std=c99 -g -Wall -Wextra -pedantic
 
-ifeq ($(PLATFORM),Darwin)
-  LDLIBS=-framework OpenCL
-else
-  LDLIBS=-lOpenCL
-endif
+SPARSE ?= sparse
+SPARSEFLAGS=-Wsparse-all -Wno-decl
 
-ifeq ($(PLATFORM),Linux)
-  LDLIBS += -ldl
-endif
+# BSD make does not define RM
+RM ?= rm -f
 
-CFLAGS+=-std=c99 -g -Wall -Wextra -pedantic
+# Common library includes
+# TODO ideally we would want this to be on "not Darwin",
+# rather than shared, but I haven't found a way to achieve this
+# using features supported by both GNU and BSD make
+LDLIBS = -lOpenCL
 
-SPARSE ?= sparse
-SPARSEFLAGS=-Wsparse-all -Wno-decl
+# OS-specific library includes
+LDLIBS_Darwin = -framework OpenCL
+LDLIBS_Linux = -ldl
+
+LDLIBS += $(LDLIBS_${OS})
 
-clinfo:
+clinfo: clinfo.o
 
 clinfo.o: clinfo.c $(HDR)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/clinfo.git



More information about the Pkg-opencl-commits mailing list