###############################################################################
#                                                                             #
#   Copyright 2005 University of Cambridge Computer Laboratory.               #
#                                                                             #
#   This file is part of Nprobe.                                              #
#                                                                             #
#   Nprobe 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.                                       #
#                                                                             #
#   Nprobe 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 Nprobe; if not, write to the Free Software                     #
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA #
#                                                                             #
###############################################################################

#
# Where to find various stuff
#

# Archive root
NPROBE_ROOT = .

# Import all relative paths defined at top level
include $(NPROBE_ROOT)/Makefile.paths

all depend tidy clean very_clean test_clean update_install install:\
	force
	$(MAKE) -C $(NPROBE_DIR) $(MFLAGS) $@
	$(MAKE) -C $(ANAL_ROOT) $(MFLAGS) $@
	$(MAKE) -C $(PY_TOOLS_DIR) $(MFLAGS) $@
	$(MAKE) -C $(TD_ROOT) $(MFLAGS) $@ 
	$(MAKE) -C $(PCAP_DIR) $(MFLAGS) $@

clobber: force
	$(MAKE) -C $(NPROBE_DIR) $(MFLAGS) $@
	$(MAKE) -C $(ANAL_ROOT) $(MFLAGS) $@
	$(MAKE) -C $(PY_TOOLS_DIR) $(MFLAGS) $@
	$(MAKE) -C $(TD_ROOT) $(MFLAGS) $@ 
	$(MAKE) -C $(PCAP_DIR) $(MFLAGS) $@
	rmdir $(INSTALL_BIN_DIR) $(INSTALL_LIB_DIR) $(INSTALL_DIR) || echo

wan owan wread sizes ckstr insert: force
	$(MAKE) -C $(NPROBE_DIR) $(MFLAGS) $@

tdump distclean: force 
	$(MAKE) -C $(TD_ROOT) $(MFLAGS) $@

libpcap: force 
	$(MAKE) -C $(TD_ROOT) $(MFLAGS) $@

pcap: force 
	$(MAKE) -C $(PCAP_DIR) $(MFLAGS) $@

generate config_probe content_t content_t_save parse_http_fields: force
	$(MAKE) -C $(NPROBE_DIR) $(MFLAGS) $@

runtime: force
	$(MAKE) -C $(NPROBE_DIR) $(MFLAGS) all

analysis: force
	$(MAKE) -C $(ANAL_ROOT) $(MFLAGS) all

analysis_paths paths: force
	$(MAKE) -C $(ANAL_DIR) $(MFLAGS) paths

analysis_paths_raw paths_raw: force
	$(MAKE) -C $(ANAL_DIR) $(MFLAGS) paths_raw

runtime_paths: force
	$(MAKE) -C $(NPROBE_DIR) $(MFLAGS) paths

runtime_paths_raw: force
	$(MAKE) -C $(NPROBE_DIR) $(MFLAGS) paths_raw

setup nprobe: all install paths

setup_raw nprobe_raw: all paths_raw

analysis_test: 
	$(MAKE) -C $(ANAL_ROOT) -s  --no-print-directory $(MFLAGS) $@

owan_test wread_test:
	$(MAKE) -C $(NPROBE_DIR) -s  --no-print-directory $(MFLAGS) $@

plotter_test: 
	$(MAKE) -C $(ANAL_ROOT) -s  --no-print-directory $(MFLAGS) $@


help:
	@less $(NPROBE_ROOT)/docs/MAKE_TARGETS

# produce command to add Python to PATH
python_path: Makefile
	@echo
	@echo '***************************************************************'
	@echo To add Python to your path execute: \
	\". $(PATHS_SETUP) 0 1 0 $(PY_DIR)\"
	@echo '***************************************************************'
	@echo


force:

