xwords/xwords4/linux/Makefile

147 lines
3.5 KiB
Makefile
Raw Normal View History

2006-05-12 09:59:38 +02:00
# -*- mode: makefile; compile-command: "make MEMDEBUG=TRUE"; -*-
# Copyright 2002 by Eric House (xwords@eehouse.org). All rights reserved.
2003-11-01 06:35:29 +01:00
#
# 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 of
# 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.
2006-02-17 08:27:36 +01:00
ifeq ($(MEMDEBUG),TRUE)
DEFINES = -DMEM_DEBUG -DDEBUG
CFLAGS += -g $(GPROFFLAG) -Wall -Wunused-parameter
2006-02-17 08:27:36 +01:00
CFLAGS += -DDEBUG_TS
PLATFORM = obj_linux_memdbg
else
DEFINES =
PLATFORM = obj_linux_rel
CFLAGS += -Os
endif
DO_CURSES = -DPLATFORM_NCURSES
DO_GTK = -DPLATFORM_GTK
SVNDEF = -D'SVN_REV="$(shell svnversion -n .)"'
CFLAGS += $(SVNDEF)
2006-02-17 08:27:36 +01:00
ifdef CURSES_ONLY
DO_GTK =
# := avoids recursion
PLATFORM := $(PLATFORM)_curses
endif
ifdef GTK_ONLY
DO_CURSES =
PLATFORM := $(PLATFORM)_gtk
endif
DEFINES += $(DO_CURSES) $(DO_GTK)
2003-11-01 06:35:29 +01:00
TARGET=$(PLATFORM)/xwords
2006-02-17 08:27:36 +01:00
2003-11-01 06:35:29 +01:00
CC = gcc
include ../common/config.mk
2006-02-17 08:27:36 +01:00
DEFINES += -DPLATFORM_LINUX -DKEY_SUPPORT -DKEYBOARD_NAV -DNODE_CAN_4
2003-11-01 06:35:29 +01:00
DEFINES += -DSTUBBED_DICT
2006-02-17 08:27:36 +01:00
ifdef DO_GTK
2004-06-27 07:03:48 +02:00
DEFINES += -DXWFEATURE_SEARCHLIMIT
2006-02-17 08:27:36 +01:00
endif
2004-06-27 07:03:48 +02:00
DEFINES += -DFEATURE_TRAY_EDIT
2003-11-01 06:35:29 +01:00
#DEFINES += -DDRAW_WITH_PRIMITIVES
DEFINES += -DBEYOND_IR
# Bluetooth support
DEFINES += -DXWFEATURE_BLUETOOTH
# Let users pick the tiles going into their trays
#DEFINES += -DFEATURE_TRAY_EDIT
DEFINES += -DDONT_ABORT_ENGINE
2006-02-17 08:27:36 +01:00
2003-11-01 06:35:29 +01:00
#-DDEBUG -DEIGHT_TILES
#GPROFFLAG = -pg
# INCLUDES += -I/usr/lib/glib/include
OBJ = $(PLATFORM)/linuxmain.o \
$(PLATFORM)/linuxdict.o \
$(PLATFORM)/gtkmain.o \
$(PLATFORM)/gtkdraw.o \
$(PLATFORM)/gtkask.o \
$(PLATFORM)/gtkletterask.o \
$(PLATFORM)/gtkpasswdask.o \
$(PLATFORM)/gtknewgame.o \
$(PLATFORM)/gtkntilesask.o \
2003-11-01 06:35:29 +01:00
$(PLATFORM)/cursesmain.o \
$(PLATFORM)/cursesdraw.o \
$(PLATFORM)/cursesask.o \
$(PLATFORM)/cursesdlgutil.o \
$(PLATFORM)/cursesletterask.o \
2003-11-01 06:35:29 +01:00
$(PLATFORM)/filestream.o \
$(PLATFORM)/linuxbt.o \
2003-11-01 06:35:29 +01:00
# $(PLATFORM)/linuxcommpipe.o \
LIBS = -pthread -lm -lbluetooth -L $(HOME)/usr/local/pilot/lib $(GPROFFLAG)
2003-11-01 06:35:29 +01:00
ifneq (,$(findstring DPLATFORM_GTK,$(DEFINES)))
2005-05-29 22:40:38 +02:00
LIBS += `pkg-config --libs gtk+-2.0`
2006-02-17 08:27:36 +01:00
CFLAGS += `pkg-config --cflags gtk+-2.0` -DPOINTER_SUPPORT \
2005-05-29 22:40:38 +02:00
-DGDK_DISABLE_DEPRECATED
2003-11-01 06:35:29 +01:00
endif
ifneq (,$(findstring DPLATFORM_NCURSES,$(DEFINES)))
LIBS += -lncurses
endif
# provides an all: target
include ../common/rules.mk
help:
2006-02-17 08:27:36 +01:00
@echo "make [MEMDEBUG=TRUE] [CURSES_ONLY=TRUE] [GTK_ONLY=TRUE]"
2003-11-01 06:35:29 +01:00
#test:
# $(MAKE) test1 DEFINES="$(DEFINES) -FOOBAR"
#test1:
# echo $(findstring FOO,$(DEFINES))
# echo $(DEFINES)
2006-02-17 08:27:36 +01:00
curses:
$(MAKE) CURSES_ONLY=TRUE
2003-11-01 06:35:29 +01:00
2006-02-17 08:27:36 +01:00
gtk:
$(MAKE) GTK_ONLY=TRUE
2003-11-01 06:35:29 +01:00
memdebug:
2006-02-17 08:27:36 +01:00
$(MAKE) MEMDEBUG=TRUE
2003-11-01 06:35:29 +01:00
gprof:
2006-02-17 08:27:36 +01:00
$(MAKE) GPROFFLAG=-pg MEMDEBUG=TRUE
2003-11-01 06:35:29 +01:00
$(TARGET): $(COMMONOBJ) $(OBJ) *.h Makefile
2006-02-17 08:27:36 +01:00
mkdir -p $(PLATFORM)
2003-11-01 06:35:29 +01:00
$(CC) $(CFLAGS) $(DEFINES) $(COMMONOBJ) $(OBJ) $(LIBS) -o $@
$(PLATFORM)/%.o: %.c
2006-02-17 08:27:36 +01:00
mkdir -p $(PLATFORM)
2003-11-01 06:35:29 +01:00
$(CC) -c $(INCLUDES) $(DEFINES) -DPLATFORM=$(PLATFORM) $(CFLAGS) $< -o $@
clean:
2006-02-27 01:08:32 +01:00
rm -rf $(PLATFORM)/*.o $(TARGET) $(DESTDIR)/usr/local/bin/xwords
2003-11-01 06:35:29 +01:00
cd ../common && $(MAKE) PLATFORM=$(PLATFORM) $@
2006-02-27 01:08:32 +01:00
install: $(TARGET)
cp $< $(DESTDIR)/usr/local/bin