sample/Makefile
author Dmitriy Morozov <dmitriy@mrzv.org>
Tue, 14 Jul 2009 09:24:29 -0700 (2009-07-14)
changeset 1 730bb27b92cf
parent 0 e2bb6f169431
permissions -rw-r--r--
Made to compile with GCC 4.3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     1
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     2
# Makefile for the sample program
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     3
#
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     4
# ANN: Approximate Nearest Neighbors
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     5
# Version: 1.1.1 08/04/06
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     6
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     7
# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     8
# David Mount.  All Rights Reserved.
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
     9
# 
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    10
# This software and related documentation is part of the Approximate
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    11
# Nearest Neighbor Library (ANN).  This software is provided under
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    12
# the provisions of the Lesser GNU Public License (LGPL).  See the
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    13
# file ../ReadMe.txt for further information.
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    14
# 
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    15
# The University of Maryland (U.M.) and the authors make no
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    16
# representations about the suitability or fitness of this software for
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    17
# any purpose.  It is provided "as is" without express or implied
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    18
# warranty.
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    19
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    20
# Revision 0.1  03/04/98
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    21
#	Initial release
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    22
# Revision 1.1.1  08/04/06
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    23
#	Added copyright/license
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    24
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    25
# Note: For full performance measurements, it is assumed that the library
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    26
# and this program have both been compiled with the -DPERF flag.  See the
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    27
# Makefile in the ANN base directory for this flag.
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    28
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    29
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    30
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    31
# Basic definitions
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    32
#		BASEDIR		where include, src, lib, ... are
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    33
#		INCDIR		include directory
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    34
#		LIBDIR		library directory
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    35
#		BINDIR		bin directory
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    36
#		LDFLAGS		loader flags
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    37
#		ANNLIBS		libraries
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    38
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    39
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    40
BASEDIR	= ..
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    41
INCDIR	= $(BASEDIR)/include
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    42
LIBDIR	= $(BASEDIR)/lib
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    43
BINDIR	= $(BASEDIR)/bin
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    44
LDFLAGS	= -L$(LIBDIR)
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    45
ANNLIBS	= -lANN -lm
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    46
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    47
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    48
# Some more definitions
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    49
#		ANNSAMP		name of sample program
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    50
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    51
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    52
ANNSAMP = ann_sample
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    53
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    54
SAMPSOURCES = ann_sample.cpp
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    55
SAMPOBJECTS = $(SAMPSOURCES:.cpp=.o)
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    56
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    57
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    58
# Make the program
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    59
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    60
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    61
default: 
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    62
	@echo "Specify a target configuration"
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    63
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    64
targets: $(BINDIR)/$(ANNSAMP)
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    65
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    66
$(BINDIR)/$(ANNSAMP): $(SAMPOBJECTS) $(LIBDIR)/$(ANNLIB)
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    67
	$(C++) $(SAMPOBJECTS) -o $(ANNSAMP) $(LDFLAGS) $(ANNLIBS)
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    68
	mv $(ANNSAMP) $(BINDIR)
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    69
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    70
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    71
# configuration definitions
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    72
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    73
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    74
include ../Make-config
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    75
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    76
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    77
# Objects
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    78
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    79
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    80
ann_sample.o: ann_sample.cpp
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    81
	$(C++) -c -I$(INCDIR) $(CFLAGS) ann_sample.cpp
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    82
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    83
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    84
# Cleaning
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    85
#-----------------------------------------------------------------------------
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    86
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    87
clean:
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    88
	-rm -f *.o *.out core
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    89
e2bb6f169431 Initial commit: ANN 1.1.1
Dmitriy Morozov <dmitriy@mrzv.org>
parents:
diff changeset
    90
realclean: clean