File: Makefile

package info (click to toggle)
x2goclient 4.1.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,224 kB
  • sloc: cpp: 26,696; perl: 1,280; sh: 525; makefile: 145
file content (140 lines) | stat: -rwxr-xr-x 5,169 bytes parent folder | download
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/make -f

TOP_DIR=$(CURDIR)
CLIENT_DIR=$(TOP_DIR)/client_build
CLIENT_BINARY=$(CLIENT_DIR)/x2goclient

SHELL=/bin/bash

INSTALL_DIR=install -d -o root -g root -m 755
INSTALL_FILE=install -o root -g root -m 644
INSTALL_SYMLINK=ln -s -f
INSTALL_PROGRAM=install -o root -g root -m 755

RM_FILE=rm -f
RM_DIR=rmdir -p --ignore-fail-on-non-empty

DESTDIR=
PREFIX=/usr/local
ETCDIR=/etc/x2go
BINDIR=$(PREFIX)/bin
SHAREDIR=$(PREFIX)/share
MANDIR=$(SHAREDIR)/man
QMAKE_BINARY=qmake
LRELEASE_BINARY=lrelease
QMAKE_OPTS=

LDFLAGS+=-lldap -lcups -lX11 -lXpm


#####################################################################
# Make sure that variables passed via the command line are not
# automatically exported.
#
# By default, such variables are exported and passed on to child
# (make) processes, which means that we will run into trouble if we
# pass CXXFLAGS="some value" as an argument to the top-level
# make call. Whatever qmake generates will be overridden by this
# definition, leading to build failures (since the code expects
# macro values to be set in some cases - which won't be the case
# for "generic" CXXFLAGS values.)
#
# Doing that turns out to be somewhat difficult, though.
#
# While preventing make from passing down *options* is possible via
# giving the new make call an empty MAKEFLAGS value and even though
# variables defined on the command line are part of MAKEFLAGS, this
# doesn't affect implicit exporting of variables (for most
# implementations.)
#
# Even worse, the correct way to this stuff differs from make
# implementation to make implementation.

# GNU make way.
MAKEOVERRIDES=

# FreeBSD and NetBSD way.
.MAKEOVERRIDES=

# OpenBSD way.
.MAKEFLAGS=


all: build

build: build_man
	$(MAKE) build_client

build_client:
	$(LRELEASE_BINARY) x2goclient.pro
	mkdir -p $(CLIENT_DIR) && cd $(CLIENT_DIR) && $(QMAKE_BINARY) QMAKE_CFLAGS="${CPPFLAGS} ${CFLAGS}" QMAKE_CXXFLAGS="${CPPFLAGS} ${CXXFLAGS}" QMAKE_LFLAGS="${LDFLAGS}" $(QMAKE_OPTS) ../x2goclient.pro
	cd $(CLIENT_DIR) && $(MAKE)

build_man:
	${MAKE} -f Makefile.man2html build

clean: clean_client clean_man
	find . -maxdepth 3 -name '*.o' -exec rm -vf {} + -type f
	find . -maxdepth 3 -name 'moc_*.cpp' -exec rm -vf {} + -type f
	find . -maxdepth 3 -name 'ui_*.h' -exec rm -vf {} + -type f
	find . -maxdepth 3 -name 'qrc_*.cpp' -exec rm -vf {} + -type f
	find . -maxdepth 3 -name 'x2goclient_*.qm' -exec rm -vf {} + -type f
	rm -f x2goclient
	rm -f x2goclient.tag
	rm -f res/txt/changelog
	rm -f res/txt/git-info

clean_client:
	rm -fr $(CLIENT_DIR)

clean_man:
	make -f Makefile.man2html clean

install: install_client install_man

install_client:
	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)/
	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/applications
	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/x2goclient/icons
	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/icons/hicolor/128x128/apps
	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/icons/hicolor/16x16/apps
	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/icons/hicolor/64x64/apps
	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/icons/hicolor/32x32/apps
	$(INSTALL_PROGRAM) $(CLIENT_DIR)/x2goclient $(DESTDIR)$(BINDIR)/x2goclient
	$(INSTALL_FILE) desktop/x2goclient.desktop    $(DESTDIR)$(SHAREDIR)/applications/x2goclient.desktop
	$(INSTALL_FILE) res/img/icons/x2goclient.xpm          $(DESTDIR)$(SHAREDIR)/x2goclient/icons/x2goclient.xpm
	$(INSTALL_FILE) res/img/icons/128x128/x2goclient.png  $(DESTDIR)$(SHAREDIR)/x2goclient/icons/x2goclient.png
	$(INSTALL_FILE) res/img/icons/128x128/x2gosession.png $(DESTDIR)$(SHAREDIR)/x2goclient/icons/x2gosession.png
	$(INSTALL_FILE) res/img/icons/128x128/x2goclient.png  $(DESTDIR)$(SHAREDIR)/icons/hicolor/128x128/apps/x2goclient.png
	$(INSTALL_FILE) res/img/icons/16x16/x2goclient.png    $(DESTDIR)$(SHAREDIR)/icons/hicolor/16x16/apps/x2goclient.png
	$(INSTALL_FILE) res/img/icons/64x64/x2goclient.png    $(DESTDIR)$(SHAREDIR)/icons/hicolor/64x64/apps/x2goclient.png
	$(INSTALL_FILE) res/img/icons/32x32/x2goclient.png    $(DESTDIR)$(SHAREDIR)/icons/hicolor/32x32/apps/x2goclient.png

install_man:
	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)/
	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man1
	$(INSTALL_FILE) man/man1/x2goclient.1    $(DESTDIR)$(MANDIR)/man1/x2goclient.1
	gzip -f $(DESTDIR)$(MANDIR)/man1/x2goclient.1

uninstall: uninstall_client uninstall_man

uninstall_client:
	$(RM_FILE) $(BINDIR)/x2goclient
	$(RM_FILE) $(SHAREDIR)/applications/x2goclient.desktop
	$(RM_FILE) $(SHAREDIR)/x2goclient/icons/x2goclient.png
	$(RM_FILE) $(SHAREDIR)/x2goclient/icons/x2goclient.xpm
	$(RM_FILE) $(SHAREDIR)/x2goclient/icons/x2gosession.png
	$(RM_FILE) $(SHAREDIR)/icons/hicolor/128x128/apps/x2goclient.png
	$(RM_FILE) $(SHAREDIR)/icons/hicolor/16x16/apps/x2goclient.png
	$(RM_FILE) $(SHAREDIR)/icons/hicolor/64x64/apps/x2goclient.png
	$(RM_FILE) $(SHAREDIR)/icons/hicolor/32x32/apps/x2goclient.png
	$(RM_DIR) $(SHAREDIR)/applications
	$(RM_DIR) $(SHAREDIR)/x2goclient/icons
	$(RM_DIR) $(SHAREDIR)/icons/hicolor/128x128/apps
	$(RM_DIR) $(SHAREDIR)/icons/hicolor/16x16/apps
	$(RM_DIR) $(SHAREDIR)/icons/hicolor/64x64/apps
	$(RM_DIR) $(SHAREDIR)/icons/hicolor/32x32/apps

uninstall_man:
	$(RM_FILE) $(MANDIR)/man1/x2goclient.1.gz
	$(RM_DIR) $(MANDIR)/man1