-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (52 loc) · 1.46 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# Builds the fpgeanyplugin package and sample project.
#
# SPDX-FileCopyrightText: (c) 2023 Robert Di Pardo
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Permitted usage is detailed in the COPYING file.
#
.PHONY: all clean deps plugin clean-deps geany-deps
PACKAGE = fpgeanyplugin
GEANY_VERSION_TAG ?= 2.0.0
PPC ?= /usr/bin/ppcx64
PPCFLAGS = -MObjFPC
DEFINES = -dLCL -dLCLgtk3
VERBOSITY = -l -vewnibq -vm5023
BUILD_MODE = Release
ifdef DEBUG
PPCFLAGS += -Scagi -CirotR -O1 -g -gl -gh -Xg -gt
BUILD_MODE = Debug
else
PPCFLAGS += -Scgi -O3 -Xs -XX
endif
ifdef SEARCH_PATHS
VERBOSITY += -vt
endif
ifdef LOGGING
VERBOSITY += -vv
endif
ifdef QUIET
VERBOSITY = -v0
endif
OUT_DIR = $(shell $(PPC) -iTP)-$(shell $(PPC) -iTO)/$(BUILD_MODE)
PPCFLAGS += -FE./lib/$(OUT_DIR) -Fi./lib/$(OUT_DIR) -Fu./lib/$(OUT_DIR) -Fu./src @gtk3.cfg
all: plugin
$(PACKAGE): deps lib/$(OUT_DIR)
$(PPC) $(PPCFLAGS) $(DEFINES) $(VERBOSITY) $(PACKAGE).pas
plugin: $(PACKAGE) example/bin/$(OUT_DIR)
$(PPC) $(PPCFLAGS) -FU./example/bin/$(OUT_DIR) $(DEFINES) $(VERBOSITY) \
-o./example/bin/$(OUT_DIR)/$(PACKAGE)demo.$(if $(findstring Win,$(OS)),dll -WR,so -Cg) \
example/$(PACKAGE)demo.lpr
deps:
@./scripts/build_gtk3_widgets $(BUILD_MODE)
geany-deps:
@./scripts/parse_headers $(GEANY_VERSION_TAG)
clean-deps:
git clean -dxf src && git --git-dir=geany/.git clean -dxf
clean:
rm -rf lib/$(OUT_DIR)/* example/bin/$(OUT_DIR)/* gtk3.cfg
lib/$(OUT_DIR):
@mkdir -p $@
example/bin/$(OUT_DIR):
@mkdir -p $@