forked from transmission-remote-gui/transgui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.fpc
99 lines (82 loc) · 2.65 KB
/
Makefile.fpc
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
[require]
packages=
[target]
programs=transgui
[prerules]
ifneq ($(findstring $(OS_TARGET),win32,win64),)
PROG_VER=$(shell type VERSION.txt)
else
PROG_VER=$(shell cat VERSION.txt)
endif
ifeq ($(LAZARUS_DIR),)
# Searching Lazarus dir
LAZARUS_DIR=$(strip $(dir $(realpath $(firstword $(strip $(wildcard $(addsuffix /lazbuild$(SRCEXEEXT),$(SEARCHPATH))))))))
lazarus_ok=$(strip $(wildcard $(LAZARUS_DIR)/lazbuild))
ifeq ($(lazarus_ok),)
LAZARUS_DIR=
# Trying home dir
lazarus_ok=$(strip $(wildcard $(HOME)/lazarus/lazbuild))
ifneq ($(lazarus_ok),)
LAZARUS_DIR=$(HOME)/lazarus
endif
endif
ifeq ($(LAZARUS_DIR),)
$(error Lazarus directory was not found. Use LAZARUS_DIR=<dir> switch.)
endif
endif
$(info Using Lazarus dir: $(LAZARUS_DIR))
LAZRES=$(LAZARUS_DIR)/tools/lazres$(SRCEXEEXT)
# Widgetset
LCL_WIDGETSET=gtk2
ifneq ($(findstring $(OS_TARGET),win32,win64),)
LCL_WIDGETSET=win32
endif
ifneq ($(findstring $(OS_TARGET),darwin),)
LCL_WIDGETSET=cocoa
endif
ifeq ($(DEBUG),)
COMP_OPT=-O3 -g- -CX -XX -Xs -Scgi -l -vewnhibq
else
COMP_OPT=-O- -g -gl -gs -dCALLSTACK -Scgi -l -vewnhibq
endif
[compiler]
unitdir=synapse/source/lib
options=-MObjFPC -dLCL -dLCL$(LCL_WIDGETSET) $(COMP_OPT)
options_darwin=-k-macosx_version_min -k10.5 -XR/Developer/SDKs/MacOSX10.5.sdk/
#Lazarus dirs
unitdir=$(LAZARUS_DIR)/lcl/units/$(FULL_TARGET)
unitdir=$(LAZARUS_DIR)/lcl/units/$(FULL_TARGET)/$(LCL_WIDGETSET)
unitdir=$(LAZARUS_DIR)/components/lazutils/lib/$(FULL_TARGET)
[rules]
#.PHONY: extraclean
transgui$(EXEEXT): $(patsubst %.lfm,%.lrs,$(wildcard *.lfm)) $(wildcard *.lfm) $(wildcard *.pas)
%.lrs: %.lfm; $(LAZRES) $@ $<
have_lazres=$(strip $(wildcard $(LAZRES)))
ifeq ($(have_lazres),)
check_lazres:
$(MAKE) -C $(LAZARUS_DIR)/tools lazres$(SRCEXEEXT)
else
check_lazres:
endif
all: check_lazres fpc_all
extraclean:
-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX), *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT) *.or *.res)
clean: extraclean fpc_clean
zipdist: all
-$(DEL) -r ./Release/dist
-$(MKDIRPROG) ./Release
$(MKDIRPROG) ./Release/dist
$(MKDIRPROG) ./Release/dist/lang
-strip ./transgui$(EXEEXT)
$(CPPROG) ./transgui$(EXEEXT) ./Release/dist
$(CPPROG) ./readme.txt ./Release/dist
$(CPPROG) ./README.md ./Release/dist
$(CPPROG) ./history.txt ./Release/dist
$(CPPROG) ./LICENSE ./Release/dist
$(CPPROG) ./transgui.png ./Release/dist
$(CPPROG) ./lang/transgui.* ./Release/dist/lang
-$(DEL) ./Release/transgui-$(PROG_VER)-$(FULL_TARGET).zip
$(MAKE) -C ./Release/dist -f ../../Makefile int_zip ZIP_FILE=transgui-$(PROG_VER)-$(FULL_TARGET).zip
-$(DEL) -r ./Release/dist
int_zip:
$(ZIPPROG) -9 -r ../$(ZIP_FILE) .