-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
30 lines (24 loc) · 952 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# TODO: make this file more portable / ditch make entirely once zig build
# supports building with 3rd party c++ compilers.
# Tabs are stupid and portable makefiles take a lot of work :(
# Use a leading space instead of a leading tab. (GNU extension)
.RECIPEPREFIX := $(.RECIPEPREFIX) #
CXX := clang++
CXX_FLAGS := -Wall -Wextra -Werror -O3 -g -std=c++17
CXX_OBJ_DIR := zig-cache/cxx
plugin_sources := src/wf.cpp src/wf-plugin.cpp
plugin_objects := $(patsubst %.cpp,$(CXX_OBJ_DIR)/%.o,$(plugin_sources))
.PHONY: plugin_objs
plugin_objs: $(dir $(plugin_objects)) $(plugin_objects)
# Prepare output directories.
# (sort for removing duplicates in the list of dirs)
$(sort $(dir $(plugin_objects))):
mkdir -p $@
# Build objs.
$(plugin_objects): $(CXX_OBJ_DIR)/%.o: %.cpp
$(CXX) \
`pkg-config --cflags wayfire` \
-fPIC \
-DWLR_USE_UNSTABLE -DWAYFIRE_PLUGIN \
$(CXX_FLAGS) \
-c $< -o $@