## AbiSource Applications
## Copyright (C) 2001 Sam Tobin-Hochstadt
##
## 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.

include $(top_srcdir)/includes.mk

CLEANFILES = abi_ver.cpp

indirectdir=$(bindir)
indirect_PROGRAMS = AbiWord_d AbiWord_s

INCLUDES=\
	 -DABIWORD_APP_NAME="\"$(ABIWORD_APP_NAME)\"" \
	$(AF_INCLUDES) $(WP_INCLUDES) $(OTHER_INCLUDES) \
	$(TEXT_INCLUDES) @GMODULE_CFLAGS@ @GTK_CFLAGS@ 

AbiWord_s_LDFLAGS = -all-static

AbiWord_d_SOURCES = abi_ver.cpp QNXMain.cpp
AbiWord_s_SOURCES = abi_ver.cpp QNXMain.cpp

REPEAT_LIBS = $(ABI_LIBS) $(ABI_LIBS) $(ABI_LIBS) $(ABI_LIBS)

AbiWord_d_LDADD = $(REPEAT_LIBS) @GTK_LIBS@ @GMODULE_LIBS@ $(OTHER_LIBS) 
AbiWord_s_LDADD = $(REPEAT_LIBS) @GTK_LIBS@ @GMODULE_LIBS@ $(OTHER_LIBS) 

abi_ver.cpp:
	cp $(srcdir)/../xp/abi_ver.cpp .

# Install the wrapper
install-exec-local:	install-wrapper
	@if test -f $(DESTDIR)/$(bindir)/abiword; then \
	  echo "$(DESTDIR)/$(bindir)/abiword is a regular file - I'm not going to create a link."; \
	else \
	  ln -sf $(DESTDIR)/$(bindir)/AbiWord $(DESTDIR)/$(bindir)/abiword; \
	fi

install-wrapper:	
	@$(top_srcdir)/src/pkg/common/unix/scripts/makewrapper.sh AbiWord $(pkgdatadir) $(bindir) $(DESTDIR)
