#### -*- mode:makefile-gmake;coding:utf-8 -*-
####*****************************************************************************
####FILE:               Makefile
####LANGUAGE:           makefile-gmake
####SYSTEM:             POSIX
####USER-INTERFACE:     NONE
####DESCRIPTION
####
####    Makefile to generate the ddns server and client
####
####AUTHORS
####    <PJB> Pascal J. Bourguignon <pjb@informatimago.com>
####MODIFICATIONS
####    2012-04-08 <PJB> Created.
####BUGS
####LEGAL
####    AGPL3
####
####    Copyright Pascal J. Bourguignon 2012 - 2012
####
####    This program is free software: you can redistribute it and/or modify
####    it under the terms of the GNU Affero General Public License as published by
####    the Free Software Foundation, either version 3 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 Affero General Public License for more details.
####
####    You should have received a copy of the GNU Affero General Public License
####    along with this program.  If not, see <http://www.gnu.org/licenses/>.
####*****************************************************************************

SERVER_INSTALL_DIR=/home/ddns/bin/
CLIENT_INSTALL_DIR=/usr/local/sbin/


CCL            = ccl
CCL_EVAL       =  --eval
CCL_LOAD       =  --load

#CLISP          = /usr/local/bin/clisp
#CLISP          = /data/languages/clisp/bin/clisp
#CLISP          = /usr/bin/clisp
CLISP          = clisp
CLISP_LOAD     =
CLISP_EVAL     = --quiet -repl -x

LISP           = $(CCL)
LOAD           = $(CCL_LOAD)
EVAL           = $(CCL_EVAL)


all: server client doc
server:ddns-server
client:ddns-client

ddns-server:server.lisp generate-server.lisp
#	$(CLISP) --quiet -ansi -Kfull -x '(load "generate-server.lisp")'
	$(LISP) $(LOAD) generate-server.lisp

ddns-client-clisp:client.lisp generate-client.lisp
	$(CLISP) --quiet -ansi -x '(load "generate-client.lisp")'

ddns-client:client.lisp generate-client.lisp
	$(CCL) $(CCL_LOAD) generate-client.lisp

install-server:
	-mkdir -p $(SERVER_INSTALL_DIR)
	[ -d $(SERVER_INSTALL_DIR) ] && install -m 755 ddns-server $(SERVER_INSTALL_DIR)

install-client:
	-mkdir -p $(CLIENT_INSTALL_DIR)
	[ -d $(CLIENT_INSTALL_DIR) ] && install -m 755 ddns-client $(CLIENT_INSTALL_DIR)

clean::
	-rm -f ddns-server ddns-client

variables:
	which clisp

doc: README.pdf

README.pdf: README
	rst2pdf README > README.pdf


#### THE END ####
ViewGit