# popsim: a simple population simulator
# Copyright (C) 2004-2006  Jouni K. SeppÃ¤nen
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

CC=gcc
#CFLAGS=-W -Wall -Wstrict-prototypes -g3 -std=gnu99 -DHAVE_INLINE
#CFLAGS=-W -Wall -Wstrict-prototypes -O3 -march=athlon-xp -DNDEBUG -std=gnu99 -DHAVE_INLINE
#CFLAGS=-W -Wall -O3 -march=pentium4 -DNDEBUG -std=gnu99 -DHAVE_INLINE
CFLAGS=-W -Wall -g3 -std=gnu99 -DHAVE_INLINE
LIBS=-lgsl -lgslcblas -lm -lfl #-lefence
OBJECTS=popsim.o famtrack.o randfun.o util.o params.o lex.yy.o parser.tab.o
CSOURCES=popsim.c famtrack.c randfun.c util.c params.c
CHEADERS=famtrack.h params.h randfun.h util.h
OTHERDIST=Makefile README LICENSE COPYING HISTORY sample.conf
VERSION=1.01

all: popsim

clean:
	rm -f popsim $(OBJECTS) lex.yy.c parser.tab.c parser.tab.h deps

dist:
	mkdir popsim-$(VERSION)
	cp -l $(CSOURCES) $(CHEADERS) $(OTHERDIST) popsim-$(VERSION)
	tar -c -f popsim-$(VERSION).tar -h popsim-$(VERSION)
	bzip2 -9 popsim-$(VERSION).tar
	rm -rf popsim-$(VERSION)

lex.yy.o: lex.yy.c parser.tab.h

lex.yy.c: parser.lex
	flex parser.lex

parser.tab.c parser.tab.h: parser.y
	bison -d parser.y

popsim: deps $(OBJECTS)
	gcc $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)

Makefile deps: $(CSOURCES)
	makedepend $(CSOURCES)
	touch deps

TAGS: $(CSOURCES) $(CHEADERS)
	etags $(CSOURCES) $(CHEADERS)

# DO NOT DELETE

