-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.mk
35 lines (28 loc) · 950 Bytes
/
config.mk
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
31
32
33
34
35
VERSION := 3.0
# Programs
CC ?= cc
LD := $(if $(shell which mold),mold,ld)
PKGCONFIG := pkg-config
# Paths
PREFIX := /usr/local
LIBPREFIX := $(PREFIX)/lib
LIBDIR := $(LIBPREFIX)/rose
BINDIR := $(PREFIX)/bin
# Gtk version (3|4)
# Default is 3
GTK ?= 4
# Includes and libraries
ifeq ($(GTK), 4)
WEBKIT_INCS := `$(PKGCONFIG) --cflags webkitgtk-6.0 webkitgtk-web-process-extension-6.0`
WEBKIT_LIBS := `$(PKGCONFIG) --libs webkitgtk-6.0 webkitgtk-web-process-extension-6.0`
else ifeq ($(GTK), 3)
WEBKIT_INCS := `$(PKGCONFIG) --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0`
WEBKIT_LIBS := `$(PKGCONFIG) --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0`
endif
LUA_INCS := `$(PKGCONFIG) --cflags lua`
LUA_LIBS := `$(PKGCONFIG) --libs lua`
CFLAGS := -Wall -Wextra -Iinclude \
-march=native -pipe \
-DVERSION=\"$(VERSION)\" -DGTK=$(GTK) \
$(WEBKIT_INCS) $(LUA_INCS) -flto
LDFLAGS := $(WEBKIT_LIBS) $(LUA_LIBS) -fuse-ld=$(LD)