forked from statgen/statgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.test
68 lines (51 loc) · 1.52 KB
/
Makefile.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
TEST_COMMAND=
EXE=
TOOLBASE =
SRCONLY =
HDRONLY =
VERSION = 0.0.1
PATH_TO_BASE=../../..
# Makefile.testtool needs to define:
# TEST_COMMAND - the commands to run under make test
# EXE - executable built for this test.
# TOOLBASE - the base filename for files with .h & .cpp versions
# SRCONLY - any cpp files without headers.
# HDRONLY - any header files without cpp
# VERSION - if not 0.0.1
# PATH_TO_BASE if it is not ../../..
include Makefile.testtool
include $(PATH_TO_BASE)/Makefile.include
#
# Goncalo's Generic Makefile -- Compiles and installs a Generic Goncalo Tool
# (c) 2000-2007 Goncalo Abecasis
#
# Source File Set
# For best results, consider editing this manually ...
TOOLHDR = $(TOOLBASE:=.h) $(HDRONLY)
TOOLSRC = $(TOOLBASE:=.cpp) $(SRCONLY)
TOOLOBJ = $(TOOLSRC:.cpp=.o)
LIBRARY = $(REQ_LIBS)
OBJECTS=$(patsubst %,$(OBJDIR)/%,$(TOOLOBJ))
# make everything
all : $(EXE)
# dependencies for executables
$(EXE) : $(LIBRARY) $(OBJECTS)
$(CXX) $(CFLAGS) -o $@ $(OBJECTS) $(LIBRARY) -lm -lz -lssl
$(OBJECTS): $(TOOLHDR) $(LIBHDR) | $(OBJDIR)
$(OBJDIR):
mkdir $(OBJDIR)
clean :
-rm -f $(OBJDIR)/*.o $(EXE) *~ results/*
test : all
$(TEST_COMMAND)
$(OBJDIR)/%.o: %.c
$(CXX) $(CFLAGS) -o $@ -c $*.c
$(OBJDIR)/%.o: %.cpp
$(CXX) $(CFLAGS) -o $@ -c $*.cpp -DVERSION="\"$(VERSION)\""
.SUFFIXES : .cpp .c .o .X.o $(SUFFIXES)
DFLAGS=-Y
cleandepend:
makedepend -- $(DFLAGS) --
depend:
makedepend -- $(DFLAGS) -- $(TOOLSRC) >/dev/null 2>&1
# DO NOT DELETE THIS LINE -- make depend depends on it