blob: fe61319670c184a03dd3176d00f0dd382e632083 (
plain)
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
|
# 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
DESTDIR=/usr
# following paths are optional; needed only for Kylix compilation
KYLIXPREFIX=/usr/local/kylix3
GTK2FORPASCAL_LIBDIR=./gtk2
### End of user writeable section
INSTALL=install -c
INSTALL_DATA = ${INSTALL} -m 644
CLEAN_OBJS=*.o *.a *.d *.s *.ppu *.dcu *.rst *~ *.~* core tuxcmd fpcver.inc
LIB_SUFFIX=`if test \`uname -m\` = x86_64; 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 ./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) )
tuxcmd_install:
if [ ! -d $(DESTDIR) ]; then mkdir -p $(DESTDIR); fi;
if [ ! -d $(DESTDIR)/bin ]; then mkdir -p $(DESTDIR)/bin; fi;
if [ ! -d $(DESTDIR)/share ]; then mkdir -p $(DESTDIR)/share; fi;
if [ ! -d $(DESTDIR)/share/doc ]; then mkdir -p $(DESTDIR)/share/doc; fi;
if [ ! -d $(DESTDIR)/share/doc/tuxcmd ]; then mkdir -p $(DESTDIR)/share/doc/tuxcmd; fi;
if [ ! -d $(DESTDIR)/lib$(LIB_SUFFIX) ]; then mkdir -p $(DESTDIR)/lib$(LIB_SUFFIX); fi;
if [ ! -d $(DESTDIR)/lib$(LIB_SUFFIX)/tuxcmd ]; then mkdir -p $(DESTDIR)/lib$(LIB_SUFFIX)/tuxcmd; fi;
$(INSTALL) ./tuxcmd $(DESTDIR)/bin
$(INSTALL_DATA) ./COPYING $(DESTDIR)/share/doc/tuxcmd
$(INSTALL_DATA) ./README $(DESTDIR)/share/doc/tuxcmd
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
|