Skip to content

Commit

Permalink
Makefile: enable i915-perf builds
Browse files Browse the repository at this point in the history
It remains disabled by default like for CMake.
  • Loading branch information
llandwerlin-intel authored and mikesart committed Mar 23, 2020
1 parent 1f1672b commit 8d51017
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
NAME = gpuvis

USE_GTK3 ?= 1
USE_I915_PERF ?= 0
CFG ?= release
ifeq ($(CFG), debug)
ASAN ?= 1
Expand All @@ -35,6 +36,12 @@ ifeq ($(USE_GTK3), 1)
GTK3FLAGS=$(shell pkg-config --cflags gtk+-3.0) -DUSE_GTK3
endif

ifeq ($(USE_I915_PERF), 1)
I915_PERF_CFLAGS=$(shell pkg-config --cflags i915-perf) -DUSE_I915_PERF
I915_PERF_LIBS=$(shell pkg-config --libs i915-perf)
endif


WARNINGS = -Wall -Wextra -Wpedantic -Wmissing-include-dirs -Wformat=2 -Wshadow -Wno-unused-parameter -Wno-missing-field-initializers
ifneq ($(COMPILER),clang)
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Expand All @@ -44,11 +51,11 @@ endif
# Investigate: Improving C++ Builds with Split DWARF
# http://www.productive-cpp.com/improving-cpp-builds-with-split-dwarf/

CFLAGS = $(WARNINGS) -march=native -fno-exceptions -gdwarf-4 -g2 -ggnu-pubnames -gsplit-dwarf $(SDL2FLAGS) $(GTK3FLAGS) -I/usr/include/freetype2
CFLAGS = $(WARNINGS) -march=native -fno-exceptions -gdwarf-4 -g2 -ggnu-pubnames -gsplit-dwarf $(SDL2FLAGS) $(GTK3FLAGS) $(I915_PERF_CFLAGS) -I/usr/include/freetype2
CFLAGS += -DUSE_FREETYPE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64
CXXFLAGS = -fno-rtti -Woverloaded-virtual -Wno-class-memaccess
LDFLAGS = -march=native -gdwarf-4 -g2 -Wl,--build-id=sha1
LIBS = -Wl,--no-as-needed -lm -ldl -lpthread -lfreetype -lstdc++ $(SDL2LIBS)
LIBS = -Wl,--no-as-needed -lm -ldl -lpthread -lfreetype -lstdc++ $(SDL2LIBS) $(I915_PERF_LIBS)

ifneq ("$(wildcard /usr/bin/ld.gold)","")
$(info Using gold linker...)
Expand Down Expand Up @@ -78,6 +85,7 @@ CFILES = \
src/imgui/imgui_demo.cpp \
src/imgui/imgui_draw.cpp \
src/GL/gl3w.c \
src/i915-perf/i915-perf-read.cpp \
src/trace-cmd/event-parse.c \
src/trace-cmd/trace-seq.c \
src/trace-cmd/kbuffer-parse.c \
Expand Down

0 comments on commit 8d51017

Please sign in to comment.