# Copyright 2013 ClinRisk Ltd.
#
# This file is part of QRISK2-2013 (http://qrisk.org, http://svn.clinrisk.co.uk/opensource/qrisk2).
#
# QRISK2-2013 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# QRISK2-2013 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with QRISK2-2013.  If not, see <http://www.gnu.org/licenses/>.
#
# Additional terms
#
# The following disclaimer must be displayed alongside any risk score generated by this code.
#   The initial version of this file, to be found at http://svn.clinrisk.co.uk/opensource/qrisk2, faithfully implements QRISK2-2013.
#   We have released this code under the GNU Lesser General Public License to enable others to implement the algorithm faithfully.
#   However, the nature of the GNU Lesser General Public License is such that we cannot prevent, for example, someone accidentally 
#   altering the coefficients, getting the inputs wrong, or just poor programming.
#   We stress, therefore, that it is the responsibility of the end user to check that the source that they receive produces the same results as the original code posted at http://svn.clinrisk.co.uk/opensource/qrisk2.
#   Inaccurate implementations of risk scores can lead to wrong patients being given the wrong treatment.
#
# This file has been auto-generated.
# XML source: Q77_qrisk2_2013_1.xml
# STATA dta time stamp: 16 Nov 2012 22:10
# This file was created on: Wed  8 May 2013 07:41:42 BST

CMDLINE_SRC=$(wildcard commandLine/*.c)
CMDLINE_OBJS = $(CMDLINE_SRC:.c=.o)
EXECUTABLES = $(CMDLINE_SRC:.c=)

LIB_SRC=$(wildcard c/*.c)
LIB_OBJ = $(LIB_SRC:.c=.o)
LIB_OUT = lib/libclinrisk.a

INCLUDES = -I include

# compiler
CC = gcc
CCFLAGS = 
LDFLAGS = 

# library paths
LIBS = -Llib -lclinrisk -lm

.SUFFIXES: .c

default: dep executables

executables: $(EXECUTABLES)
	cp $(EXECUTABLES) executables

$(EXECUTABLES): $(LIB_OUT)

.c:
	$(CC) $(INCLUDES) $(LDFLAGS) $< -o $@ $(LIBS)

.c.o:
	$(CC) $(INCLUDES) $(CCFLAGS) -c $< -o $@

$(LIB_OUT): $(LIB_OBJ)
	ar rcs $(LIB_OUT) $(LIB_OBJ)

depend: dep

dep:
	makedepend -- $(CFLAGS) -- -I /usr/include/linux $(INCLUDES) $(LIB_SRC)

clean:
	rm -f $(LIB_OBJ) $(LIB_OUT) Makefile.bak
	rm -f $(CMDLINE_OBJ) $(CMDLINE_PROGS) 
	rm -f executables/*

# DO NOT DELETE
