-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: falkTX <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,67 @@ | ||
# Copyright 2024 Filipe Coelho <[email protected]> | ||
# SPDX-License-Identifier: ISC | ||
|
||
CFLAGS += -std=c11 | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
# Set C / C++ language version and base flags | ||
|
||
TARGETS = lv2-gtk-ui-bridge.lv2/lv2-gtk-ui-bridge.so | ||
CFLAGS += -std=c11 -Wall -Wextra -Wno-unused-value | ||
CXXFLAGS += -std=c++11 -Wall -Wextra -Wno-unused-value | ||
|
||
TARGETS += lv2-gtk-ui-bridge.lv2/lv2-gtk2-ui-bridge | ||
TARGETS += lv2-gtk-ui-bridge.lv2/lv2-gtk3-ui-bridge | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
# Use vendored LV2 if available | ||
|
||
ifneq (,$(wildcard lv2/include)) | ||
LV2_FLAGS = -Ilv2/include | ||
else | ||
LV2_FLAGS = $(shell pkg-config --cflags --libs lv2) | ||
endif | ||
|
||
# --------------------------------------------------------------------------------------------------------------------- | ||
# Set per-system flags | ||
|
||
TARGET_MACHINE := $(shell $(CC) -dumpmachine) | ||
|
||
ifneq (,$(findstring apple,$(TARGET_MACHINE))) | ||
SERVER_FLAGS = -fPIC -dynamiclib | ||
else ifneq (,$(findstring mingw,$(TARGET_MACHINE))) | ||
APP_EXT = .exe | ||
CFLAGS += -mstackrealign | ||
CXXFLAGS += -mstackrealign | ||
LDFLAGS += -static | ||
SERVER_FLAGS = -shared -Wl,-no-undefined | ||
else | ||
CLIENT_FLAGS = $(shell pkg-config --cflags --libs x11) -ldl | ||
SERVER_FLAGS = -fPIC -shared -Wl,-no-undefined | ||
SHM_LIBS = -lrt | ||
endif | ||
|
||
# --------------------------------------------------------------------------------------------------------------------- | ||
# Build targets | ||
|
||
TARGETS = lv2-gtk-ui-bridge.lv2/lv2-gtk-ui-bridge.so | ||
TARGETS += lv2-gtk-ui-bridge.lv2/lv2-gtk2-ui-bridge$(APP_EXT) | ||
TARGETS += lv2-gtk-ui-bridge.lv2/lv2-gtk3-ui-bridge$(APP_EXT) | ||
|
||
# --------------------------------------------------------------------------------------------------------------------- | ||
|
||
all: $(TARGETS) | ||
|
||
lv2-gtk-ui-bridge.lv2/lv2-gtk-ui-bridge.so: src/ui-server.c src/ipc/*.h | ||
$(CC) $< $(CFLAGS) $(LDFLAGS) $(shell pkg-config --cflags --libs lv2) -fPIC -shared -lrt -Wl,-no-undefined -o $@ | ||
$(CC) $< $(CFLAGS) $(LDFLAGS) $(LV2_FLAGS) $(SERVER_FLAGS) $(SHM_LIBS) -o $@ | ||
|
||
lv2-gtk-ui-bridge.lv2/lv2-gtk2-ui-bridge$(APP_EXT): src/ui-client.c src/ipc/*.h | ||
$(CC) $< $(CFLAGS) $(LDFLAGS) $(LV2_FLAGS) $(shell pkg-config --cflags --libs gtk+-2.0 lilv-0) -DUI_GTK2 $(CLIENT_FLAGS) $(SHM_LIBS) -Wno-deprecated-declarations -o $@ | ||
|
||
lv2-gtk-ui-bridge.lv2/lv2-gtk2-ui-bridge: src/ui-client.c src/ipc/*.h | ||
$(CC) $< $(CFLAGS) $(LDFLAGS) $(shell pkg-config --cflags --libs gtk+-2.0 lilv-0 lv2 x11) -DUI_GTK2 -ldl -lrt -Wno-deprecated-declarations -o $@ | ||
lv2-gtk-ui-bridge.lv2/lv2-gtk3-ui-bridge$(APP_EXT): src/ui-client.c src/ipc/*.h | ||
$(CC) $< $(CFLAGS) $(LDFLAGS) $(LV2_FLAGS) $(shell pkg-config --cflags --libs gtk+-3.0 lilv-0) -DUI_GTK3 $(CLIENT_FLAGS) $(SHM_LIBS) -Wno-deprecated-declarations -o $@ | ||
|
||
lv2-gtk-ui-bridge.lv2/lv2-gtk3-ui-bridge: src/ui-client.c src/ipc/*.h | ||
$(CC) $< $(CFLAGS) $(LDFLAGS) $(shell pkg-config --cflags --libs gtk+-3.0 lilv-0 lv2 x11) -DUI_GTK3 -ldl -lrt -Wno-deprecated-declarations -o $@ | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
|
||
test: src/test.c src/ipc/*.h | ||
$(CC) $< $(CFLAGS) $(LDFLAGS) -Wall -Wextra -o $@ | ||
$(CC) $< $(CFLAGS) $(LDFLAGS) -Wall -Wextra -o $@$(APP_EXT) | ||
|
||
testxx: src/test.c src/ipc/*.h | ||
$(CXX) $< $(CXXFLAGS) $(LDFLAGS) -Wall -Wextra -o $@ | ||
$(CXX) $< $(CXXFLAGS) $(LDFLAGS) -Wall -Wextra -o $@$(APP_EXT) | ||
|
||
clean: | ||
rm -f $(TARGETS) | ||
rm -f $(TARGETS) test testxx *.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters