# Makefile -- Tux Commander build system # # Copyright (C) 2008 Tomas Bzatek # 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 CFLAGS= -vweh -Un -Ci -Co 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) \ -d__FPC__ \ -Fu./libgtk_kylix -Fu./translations -Fu./vfs \ tuxcmd.dpr debug: CFLAGS += -g debug: tuxcmd kylix:: $(KYLIXPREFIX)/bin/dcc -DKYLIX \ -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