File: Makefile

package info (click to toggle)
tuxcmd 0.6.70%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 3,612 kB
  • ctags: 2,757
  • sloc: pascal: 49,754; ansic: 2,272; makefile: 106
file content (148 lines) | stat: -rw-r--r-- 5,837 bytes parent folder | download | duplicates (3)
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
141
142
143
144
145
146
147
148
# Makefile -- Tux Commander build system
#
#    Copyright (C) 2008 Tomas Bzatek <tbzatek@users.sourceforge.net>
#    Check for updates on tuxcmd.sourceforge.net
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty or
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


#  Specify paths
DEFAULT_DESTDIR=/usr

# following paths are optional; needed only for Kylix compilation
KYLIXPREFIX=/usr/local/kylix3
GTK2FORPASCAL_LIBDIR=./gtk2

###  End of user writeable section



DESTDIR=$(DEFAULT_DESTDIR)
INSTALL=install
CLEAN_OBJS=*.o *.a *.d *.s *.ppu *.dcu *.rst *~ *.~* core tuxcmd fpcver.inc
LIB_SUFFIX=`if test \`uname -m\` = x86_64 -o \`uname -m\` = ppc64; then echo 64; fi`


# -Ct must be disabled here, causes unneeded crashes
# -CR and -Cr must be disabled here, causes range check errors with gnome-power-manager
# -Cg generates internal compiler errors on i386
# -XX prevents linking errors of unresolved and unused symbols
# "-k-z noexecstack" (with quotes as a single parameter) avoids marking stack as executable, allowing to work correctly with SELinux in Enforcing mode
CFLAGS= -vweh -Un -Ci -Co -XX "-k-z noexecstack"
EXTRA_CFLAGS= -O3


tuxcmd::
	echo "const" > fpcver.inc
	echo "  ConstFPCVersionString = '`fpc -iW`';" >> fpcver.inc
	echo "  ConstFPCDateString = '`fpc -iD`';" >> fpcver.inc
	echo "  ConstFPCCompilerOSString = '`fpc -iSO`';" >> fpcver.inc
	echo "  ConstFPCCompilerHostProcessorString = '`fpc -iSP`';" >> fpcver.inc
	echo "  ConstFPCTargetOSString = '`fpc -iTO`';" >> fpcver.inc
	echo "  ConstFPCTargetProcessorString = '`fpc -iTP`';" >> fpcver.inc
	fpc -Mdelphi $(CFLAGS) $(EXTRA_CFLAGS) \
	    -Fu./libgtk_kylix -Fu./translations -Fu./vfs \
	    tuxcmd.dpr


debug: EXTRA_CFLAGS = -g -gl -gv -O-
debug: tuxcmd

final_debug: EXTRA_CFLAGS = -g -gl -gv -O3
final_debug: tuxcmd

kylix::
	$(KYLIXPREFIX)/bin/dcc -DKYLIX -V -H -W -$$X+ -$$I+ -$$D+ -$$I+ -$$L+ -$$M+ -$$Q+ -$$R+ -$$W+ -$$Y+ \
	-U$(GTK2FORPASCAL_LIBDIR)/glib -U$(GTK2FORPASCAL_LIBDIR)/pango \
	-U$(GTK2FORPASCAL_LIBDIR)/atk -U$(GTK2FORPASCAL_LIBDIR)/gtk+/gtk \
	-U$(GTK2FORPASCAL_LIBDIR)/gtk+/gdk -U$(GTK2FORPASCAL_LIBDIR)/gtk+/gdk-pixbuf \
	-U$(KYLIXPREFIX)/lib \
	-U./libgtk_kylix -U./translations -U./vfs -U./compat ./tuxcmd.dpr


modules::
	(cd "vfs" && $(MAKE) `echo $@ | sed s/-recursive//` ) || exit 1;

modules_install:
	(cd "vfs" && $(MAKE) install "$(DESTDIR)") || exit 1;



clean cleandir:
	rm -f $(CLEAN_OBJS)
	( cd vfs && rm -f $(CLEAN_OBJS) )
	( cd libgtk_kylix && rm -f $(CLEAN_OBJS) )
	( cd translations && rm -f $(CLEAN_OBJS) )
	( cd compat && rm -f $(CLEAN_OBJS) )


gtk_update_icon_cache = gtk-update-icon-cache -f -t $(DESTDIR)/share/icons/hicolor

tuxcmd_install:
	$(INSTALL) -d $(DESTDIR)/bin
	$(INSTALL) -m 755 tuxcmd $(DESTDIR)/bin
	$(INSTALL) -d $(DESTDIR)/lib$(LIB_SUFFIX)/tuxcmd
	$(INSTALL) -d $(DESTDIR)/share/doc/tuxcmd
	$(INSTALL) -m 644 README $(DESTDIR)/share/doc/tuxcmd
	
	desktop-file-install -m 644 --dir $(DESTDIR)/share/applications data/tuxcmd.desktop
	
	$(INSTALL) -d $(DESTDIR)/share/icons/hicolor/16x16/apps
	$(INSTALL) -m 644 data/icons/16x16/tuxcmd.png $(DESTDIR)/share/icons/hicolor/16x16/apps
	$(INSTALL) -d $(DESTDIR)/share/icons/hicolor/24x24/apps
	$(INSTALL) -m 644 data/icons/24x24/tuxcmd.png $(DESTDIR)/share/icons/hicolor/24x24/apps
	$(INSTALL) -d $(DESTDIR)/share/icons/hicolor/32x32/apps
	$(INSTALL) -m 644 data/icons/32x32/tuxcmd.png $(DESTDIR)/share/icons/hicolor/32x32/apps
	$(INSTALL) -d $(DESTDIR)/share/icons/hicolor/48x48/apps
	$(INSTALL) -m 644 data/icons/48x48/tuxcmd.png $(DESTDIR)/share/icons/hicolor/48x48/apps
	$(INSTALL) -d $(DESTDIR)/share/icons/hicolor/64x64/apps
	$(INSTALL) -m 644 data/icons/64x64/tuxcmd.png $(DESTDIR)/share/icons/hicolor/64x64/apps
	$(INSTALL) -d $(DESTDIR)/share/icons/hicolor/128x128/apps
	$(INSTALL) -m 644 data/icons/128x128/tuxcmd.png $(DESTDIR)/share/icons/hicolor/128x128/apps
	$(INSTALL) -d $(DESTDIR)/share/icons/hicolor/scalable/apps
	$(INSTALL) -m 644 data/icons/scalable/tuxcmd.svg $(DESTDIR)/share/icons/hicolor/scalable/apps
	
	@-if test "$(DESTDIR)" = "$(DEFAULT_DESTDIR)"; then \
		echo "Updating Gtk icon cache."; \
		$(gtk_update_icon_cache); \
	else \
		echo "*** Icon cache not updated.  After install, run this:"; \
		echo "***   $(gtk_update_icon_cache)"; \
	fi


uninstall:
	if [ -f $(DESTDIR)/bin/tuxcmd ]; then rm -f $(DESTDIR)/bin/tuxcmd; fi;
	if [ -d $(DESTDIR)/share/doc/tuxcmd ]; then rm -Rf $(DESTDIR)/share/doc/tuxcmd; fi;
	if [ -d $(DESTDIR)/lib$(LIB_SUFFIX)/tuxcmd ]; then rm -Rf $(DESTDIR)/lib$(LIB_SUFFIX)/tuxcmd; fi;

help::
	@echo "Tux Commander build system"
	@echo
	@echo "Following targets are available:"
	@echo
	@echo "  tuxcmd              Build tuxcmd with FreePascal [default]"
	@echo "  kylix               Build tuxcmd with Kylix (needs paths setup in Makefile)"
	@echo "  install             Install tuxcmd to the system (DESTDIR overrides default path)"
	@echo "  uninstall           Remove tuxcmd from the system (DESTDIR overrides default path)"
	@echo "  clean               Cleanup the build structure"
	@echo "  modules             Build modules (in vfs/)"
	@echo "  modules_install     Install modules to the system"
	@echo
	@exit 0

install: tuxcmd_install

all: tuxcmd