#
#  The contents of this file are subject to the terms of the
#  Common Development and Distribution License, Version 1.0 only
#  (the "License").  You may not use this file except in compliance
#  with the License.
# 
#  You can obtain a copy of the license at 
#  http://www.opensource.org/licenses/cddl1.php
# 
#  When distributing Covered Code, include this CDDL HEADER in each
#  file and include the original License file at src/license.txt.
#  If applicable, add the following below this CDDL HEADER, with the
#  fields enclosed by brackets "[ ]" replaced with your own identifying
#  information: Portions Copyright [yyyy] [name of copyright owner]
# 

#  Copyright (c) 2006 by Centeris, Inc.  All rights reserved.
#  Use is subject to license terms.
#  Initial Developer updates, news, and information may be found at 
#  http://sourceforge.net/projects/likewiseopenagt
#

# TODO: Change this to the actual location of the Samba sources!
SAMBA_SRC_DIR=/samba-trunk/source
TDB_SRC_DIR=$(SAMBA_SRC_DIR)/tdb

CFLAGS = -g -I$(SAMBA_SRC_DIR)/include -I$(TDB_SRC_DIR)
CC = gcc

PROGS = perf_writer
TDB_OBJ = $(TDB_SRC_DIR)/tdb.o $(TDB_SRC_DIR)/spinlock.o $(TDB_SRC_DIR)/tdbback.o
PERF_WRITER_OBJ = perf_writer.o perf_writer_mem.o perf_writer_util.o perf_writer_cpu.o perf_writer_process.o perf_writer_logical_disk.o perf_writer_physical_disk.o perf_writer_apache.o

default: $(PROGS)

$(TDB_OBJ):
	cd $(TDB_SRC_DIR) && make

perf_writer: $(PERF_WRITER_OBJ) $(TDB_OBJ)
	$(CC) $(CFLAGS) -o perf_writer $(PERF_WRITER_OBJ) $(TDB_OBJ)

clean:
	rm -f $(PROGS) *.o *~ *% core
