summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-01-13 22:40:51 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-01-19 14:23:00 +1000
commiteb0f35923fb4119800c19f9843e7e4125804ee24 (patch)
tree9908bdf7643678b9936e247f668cf66471d4d6a4 /Makefile
parent6ee2fc67c942941c74f594078cdb6f04f8512dbe (diff)
downloadnouveau-eb0f35923fb4119800c19f9843e7e4125804ee24.tar.gz
drm: remove symlinks from build, use Kbuild files for lib build
The DRM build used a separate, symlinked, source tree out of a desire to avoid Kbuild/autotools' object files conflicting. Not only is this very annoying to maintain, but it's made worse by having two entirely separate source file lists to maintain too. Fixes both these issues by ditching automake (it doesn't approve of the kernel's Kbuild syntax) in favour of custom makefiles that can build libnvif.so from the Kbuild files. Like the previous commit, this will never show up in the kernel tree (it has its own version). Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..c003ff4e1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,49 @@
+.PHONY: all build clean install
+all: build
+
+prefix ?= /usr/local
+bindir ?= $(prefix)/bin
+libdir ?= $(prefix)/lib
+
+top := .
+drm := $(top)/drm/nouveau
+lib := $(top)/lib
+bin := $(top)/bin
+
+CFLAGS ?= -O0 -ggdb3
+CFLAGS += -I$(lib)/include -I$(drm)/include -I$(drm)/include/nvkm \
+ -I$(drm)/nvkm -I/usr/include/libdrm \
+ -fno-strict-aliasing -Wall -Wundef -Wstrict-prototypes \
+ -DCONFIG_NOUVEAU_DEBUG=7 \
+ -DCONFIG_NOUVEAU_DEBUG_DEFAULT=3 \
+ -DCONFIG_NOUVEAU_I2C_INTERNAL \
+ -DCONFIG_NOUVEAU_I2C_INTERNAL_DEFAULT
+ENVYAS ?= envyas
+ENVYPP = $(CC) -E -CC -xc $(1) | $(CC) -E - | sed -e "/^\#/d"
+INSTALL ?= install
+
+deps :=
+objs :=
+libs :=
+bins :=
+fws :=
+
+include $(lib)/Makefile
+include $(bin)/Makefile
+
+build: $(bins)
+
+clean:
+ @rm -f $(deps) $(objs) $(libs) $(bins)
+
+clean-fw:
+ @rm -f $(fws)
+
+install-lib = $(INSTALL) -D -m 755 $(1) $(libdir);
+install-bin = $(INSTALL) -D -m 755 $(1) $(bindir);
+install:
+ $(foreach lib,$(libs),$(call install-lib,$(lib)))
+ ldconfig $(libdir)
+ $(foreach bin,$(bins),$(call install-bin,$(bin)))
+
+-include $(deps)