# Makefile for memory based Hurd filesystems
# Copyright (C) 2000 Farid Hajji <farid.hajji@ob.kamp.net>
# $Id: Makefile,v 1.2 2013/02/10 10:34:00 sthibaul Exp $

# 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, 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

# $Log: Makefile,v $
# Revision 1.2  2013/02/10 10:34:00  sthibaul
# 2013-02-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
#
# 	Fix build against libpthread.
#
# 	* Makefile: Link against libpthread instead of libthreads.
# 	* README: Advise to lib against libbpthread instead of advising to
# 	link against libthreads.
# 	* debug.c: Include pthread.h instead of cthreads.h and rwlock.h. Use
# 	pthread_mutex instead of Mach mutex.
# 	* membfs: Likewise, use pthread_rwlock_t instead of Mach rwlock.
#
# Revision 1.1  2006/04/12 21:43:03  mmenal
# Initial commit of a memfs written by Farid Hajji (Manuel)
#
# Revision 1.1  2000/12/19 18:53:19  farid
# Initial revision
#

CC      = gcc
CFLAGS  = -D_GNU_SOURCE -Wall -g -D_FILE_OFFSET_BITS=64
#CFLAGS  = -Wall -O2
LDFLAGS = -lpthread -lports -ltrivfs -lfshelp
#HURDLIBS = -lpthread -lports -ltrivfs -lfshelp -lpipe -lihash -lshouldbeinlibc
SRC     = memfs.c debug.c
OBJ     = $(SRC:%.c=%.o)
TRANS   = memfs
TEST    = memfs-test

# Name of the test node
TNODE   = tnode

all: $(TRANS) $(TEST) start-trans

$(TRANS): $(OBJ)

$(TEST): $(TEST).c
	$(CC) $< -o $@

start-trans: $(TRANS)
	settrans -ac $(TNODE) ./$(TRANS) --debug 10 --write-back bak

stop-trans:
	settrans -fg $(TNODE)

clean: stop-trans
	rm -f $(TRANS) $(TEST) $(OBJ) $(TNODE) .out
