forked from sparsehash/sparsehash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
132 lines (109 loc) · 5.21 KB
/
Makefile.am
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
## Process this file with automake to produce Makefile.in
# Make sure that when we re-make ./configure, we get the macros we need
ACLOCAL_AMFLAGS = -I m4
# This is so we can #include <google/foo>
AM_CPPFLAGS = -I$(top_srcdir)/src
# These are good warnings to turn on by default
if GCC
AM_CXXFLAGS = -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
endif
googleincludedir = $(includedir)/google
## The .h files you want to install (that is, .h files that people
## who install this package can include in their own applications.)
googleinclude_HEADERS = \
src/google/dense_hash_map \
src/google/dense_hash_set \
src/google/sparse_hash_map \
src/google/sparse_hash_set \
src/google/sparsetable \
src/google/type_traits.h
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
## This is for HTML and other documentation you want to install.
## Add your documentation files (in doc/) in addition to these boilerplate
## Also add a TODO file if you have one
dist_doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README README.windows \
TODO \
doc/dense_hash_map.html \
doc/dense_hash_set.html \
doc/sparse_hash_map.html \
doc/sparse_hash_set.html \
doc/sparsetable.html \
doc/implementation.html \
doc/performance.html \
doc/index.html \
doc/designstyle.css
## The libraries (.so's) you want to install
lib_LTLIBRARIES =
## The location of the windows project file for each binary we make
WINDOWS_PROJECTS = google-sparsehash.sln
## unittests you want to run when people type 'make check'.
## TESTS is for binary unittests, check_SCRIPTS for script-based unittests.
## TESTS_ENVIRONMENT sets environment variables for when you run unittest,
## but it only seems to take effect for *binary* unittests (argh!)
TESTS = type_traits_unittest sparsetable_unittest hashtable_unittest
WINDOWS_PROJECTS += vsprojects/type_traits_unittest/type_traits_unittest.vcproj \
vsprojects/sparsetable_unittest/sparsetable_unittest.vcproj \
vsprojects/hashtable_unittest/hashtable_unittest.vcproj
check_SCRIPTS =
TESTS_ENVIRONMENT =
## This should always include $(TESTS), but may also include other
## binaries that you compile but don't want automatically installed.
noinst_PROGRAMS = $(TESTS) time_hash_map
WINDOWS_PROJECTS += vsprojects/time_hash_map/time_hash_map.vcproj
## vvvv RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
# All our .h files need to read the config information in config.h. The
# autoheader config.h has too much info, including PACKAGENAME, that
# might conflict with other config.h's an application might #include.
# Thus, we create a "minimal" config.h, called sparseconfig.h, that
# includes only the #defines we really need, and that are unlikely to
# change from system to system. NOTE: The awk command is equivalent to
# fgrep -B2 -f- $(top_builddir)/src/config.h \
# fgrep -vx -e -- > _sparsehash_config
src/google/sparsehash/sparseconfig.h: $(top_builddir)/src/config.h \
$(top_srcdir)/src/config.h.include
[ -d $(@D) ] || mkdir -p $(@D)
$(AWK) 'ARGIND == 1 {if ($$0 !~ /^ *$$/) {inc[$$0]=0; next}}; { for (i in inc) { if (index($$0, i) != 0) {print "\n"prevline"\n"$$0; delete inc[i]} }; prevline=$$0; };' \
$(top_srcdir)/src/config.h.include $(top_builddir)/src/config.h \
> $(@D)/_sparsehash_config
mv -f $(@D)/_sparsehash_config $@
# This is how we tell automake about auto-generated .h files
BUILT_SOURCES = src/google/sparsehash/sparseconfig.h
CLEANFILES = src/google/sparsehash/sparseconfig.h
sparsehashincludedir = $(googleincludedir)/sparsehash
sparsehashinclude_HEADERS = \
src/google/sparsehash/densehashtable.h \
src/google/sparsehash/sparsehashtable.h \
src/google/sparsehash/sparseconfig.h
type_traits_unittest_SOURCES = \
src/type_traits_unittest.cc \
$(sparsehashinclude_HEADERS) \
src/google/type_traits.h
sparsetable_unittest_SOURCES = \
src/sparsetable_unittest.cc \
$(sparsehashinclude_HEADERS) \
src/google/sparsetable
hashtable_unittest_SOURCES = \
src/hashtable_unittest.cc \
$(googleinclude_HEADERS) \
$(sparsehashinclude_HEADERS) \
src/words
time_hash_map_SOURCES = \
src/time_hash_map.cc \
$(sparsehashinclude_HEADERS) \
$(googleinclude_HEADERS)
# If tcmalloc is installed, use it with time_hash_map; it gives us
# heap-usage statistics for the hash_map routines, which is very nice
time_hash_map_CXXFLAGS = @tcmalloc_flags@ $(AM_CXXFLAGS)
time_hash_map_LDFLAGS = @tcmalloc_flags@
time_hash_map_LDADD = @tcmalloc_libs@
## ^^^^ END OF RULES TO MAKE THE LIBRARIES, BINARIES, AND UNITTESTS
rpm: dist-gzip packages/rpm.sh packages/rpm/rpm.spec
@cd packages && ./rpm.sh ${PACKAGE} ${VERSION}
deb: dist-gzip packages/deb.sh packages/deb/*
@cd packages && ./deb.sh ${PACKAGE} ${VERSION}
# Windows wants write permission to .vcproj files and maybe even sln files.
dist-hook:
test -e "$(distdir)/vsprojects" \
&& chmod -R u+w $(distdir)/*.sln $(distdir)/vsprojects/
EXTRA_DIST = packages/rpm.sh packages/rpm/rpm.spec packages/deb.sh packages/deb \
src/config.h.include src/windows $(WINDOWS_PROJECTS) experimental