-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.am
218 lines (182 loc) · 5.81 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# Add the m4 directory to the include path for aclocal
ACLOCAL_AMFLAGS=-I m4
# Set up global variables
LIBNAME = lithe
CAP_LIBNAME = Lithe
SRCDIR = $(srcdir)/@SRCDIR@
LIB_CFILES = \
@SRCDIR@/fatal.c \
@SRCDIR@/defaults.c \
@SRCDIR@/barrier.c \
@SRCDIR@/lithe.c \
@SRCDIR@/condvar.c \
@SRCDIR@/semaphore.c \
@SRCDIR@/futex.c \
@SRCDIR@/mutex.c \
@SRCDIR@/fork_join_sched.c
LIB_CXXFILES = \
@SRCDIR@/sched.cc \
@SRCDIR@/context.cc
LIB_HFILES = \
@SRCDIR@/context.h \
@SRCDIR@/defaults.h \
@SRCDIR@/fatal.h \
@SRCDIR@/hart.h \
@SRCDIR@/barrier.h \
@SRCDIR@/condvar.h \
@SRCDIR@/semaphore.h \
@SRCDIR@/futex.h \
@SRCDIR@/mutex.h \
@SRCDIR@/lithe.h \
@SRCDIR@/sched.h \
@SRCDIR@/fork_join_sched.h
LIB_HHFILES = \
@SRCDIR@/lithe.hh \
@SRCDIR@/sched.hh \
@SRCDIR@/context.hh
TEST_EXECS = \
test_cls \
test_mutex \
test_syscalls \
test_recursive_mutex \
test_condvar \
test_parent \
test_scheduler \
test_mutex_cc \
test_recursive_mutex_cc \
test_condvar_cc \
test_parent_cc \
test_scheduler_cc
# Setup parameters to build the library
lib_LTLIBRARIES = libithe.la
libithe_la_CFLAGS = $(AM_CFLAGS)
libithe_la_CXXFLAGS = $(AM_CXXFLAGS)
libithe_la_SOURCES = $(LIB_CFILES) $(LIB_HFILES)
libithe_la_SOURCES += $(LIB_CXXFILES) $(LIB_HHFILES)
if STATIC_ONLY
libithe_la_LIBADD = $(LPARLIB) -lpthread
libithe_la_LDFLAGS = -all-static
else
libithe_la_LIBADD = $(LPARLIB)
endif
# Setup a directory where all of the include files will be installed
litheincdir = $(includedir)/$(LIBNAME)
dist_litheinc_DATA = $(LIB_HFILES) $(LIB_HHFILES)
# Setup parameters to build the test programs
check_PROGRAMS = $(TEST_EXECS)
test_cls_SOURCES = @TESTSDIR@/test-cls.c
test_cls_CFLAGS = $(AM_CFLAGS)
test_cls_CFLAGS += -I$(srcdir)
test_cls_LDADD = -lithe $(LPARLIB)
test_syscalls_SOURCES = @TESTSDIR@/test-syscalls.c
test_syscalls_CFLAGS = $(AM_CFLAGS)
test_syscalls_CFLAGS += -I$(srcdir)
test_syscalls_LDADD = -lithe $(LPARLIB)
test_mutex_SOURCES = @TESTSDIR@/test-mutex.c
test_mutex_CFLAGS = $(AM_CFLAGS)
test_mutex_CFLAGS += -I$(srcdir)
test_mutex_LDADD = -lithe $(LPARLIB)
test_recursive_mutex_SOURCES = @TESTSDIR@/test-recursive-mutex.c
test_recursive_mutex_CFLAGS = $(AM_CFLAGS)
test_recursive_mutex_CFLAGS += -I$(srcdir)
test_recursive_mutex_LDADD = -lithe $(LPARLIB)
test_condvar_SOURCES = @TESTSDIR@/test-condvar.c
test_condvar_CFLAGS = $(AM_CFLAGS)
test_condvar_CFLAGS += -I$(srcdir)
test_condvar_LDADD = -lithe $(LPARLIB)
test_parent_SOURCES = @TESTSDIR@/test-parent.c
test_parent_CFLAGS = $(AM_CFLAGS)
test_parent_CFLAGS += -I$(srcdir)
test_parent_LDADD = -lithe $(LPARLIB)
test_scheduler_SOURCES = @TESTSDIR@/test-scheduler.c
test_scheduler_CFLAGS = $(AM_CFLAGS)
test_scheduler_CFLAGS += -I$(srcdir)
test_scheduler_LDADD = -lithe $(LPARLIB)
test_mutex_cc_SOURCES = @TESTSDIR@/test-mutex.cc
test_mutex_cc_CXXFLAGS = $(AM_CXXFLAGS)
test_mutex_cc_CXXFLAGS += -I$(srcdir)
test_mutex_cc_LDADD = -lithe $(LPARLIB)
test_recursive_mutex_cc_SOURCES = @TESTSDIR@/test-recursive-mutex.cc
test_recursive_mutex_cc_CFLAGS = $(AM_CFLAGS)
test_recursive_mutex_cc_CFLAGS += -I$(srcdir)
test_recursive_mutex_cc_LDADD = -lithe $(LPARLIB)
test_condvar_cc_SOURCES = @TESTSDIR@/test-condvar.cc
test_condvar_cc_CXXFLAGS = $(AM_CXXFLAGS)
test_condvar_cc_CXXFLAGS += -I$(srcdir)
test_condvar_cc_LDADD = -lithe $(LPARLIB)
test_parent_cc_SOURCES = @TESTSDIR@/test-parent.cc
test_parent_cc_CXXFLAGS = $(AM_CXXFLAGS)
test_parent_cc_CXXFLAGS += -I$(srcdir)
test_parent_cc_LDADD = -lithe $(LPARLIB)
test_scheduler_cc_SOURCES = @TESTSDIR@/test-scheduler.cc
test_scheduler_cc_CXXFLAGS = $(AM_CXXFLAGS)
test_scheduler_cc_CXXFLAGS += -I$(srcdir)
test_scheduler_cc_LDADD = -lithe $(LPARLIB)
if SPHINX_BUILD
man_MANS = \
doc/man/$(LIBNAME).1
# Don't suppport doing things this way for now because automake is dumb and
# doesn't allow 'generated' texi files...
# Instead we'll add the generated .info file and install it manually...
#info_TEXINFOS = \
# doc/texinfo/$(CAP_LIBNAME).texi
# Include pre-generated documentation in the distribution
EXTRA_DIST = \
doc/html \
doc/singlehtml \
doc/man \
doc/texinfo/$(CAP_LIBNAME).info \
doc/latex/$(CAP_LIBNAME).pdf
$(abs_builddir)/doc/%: | $(abs_builddir)/doc
cd $(srcdir)/doc; \
if [ -f Makefile ]; then \
make BUILDDIR=$(abs_builddir)/doc $(@F); \
else \
cp -R $(@F) $(@D); \
fi;
$(abs_builddir)/doc/texinfo/$(CAP_LIBNAME).info: | $(abs_builddir)/doc
cd $(srcdir)/doc; \
if [ -f Makefile ]; then \
make BUILDDIR=$(abs_builddir)/doc info; \
else \
cp -R texinfo $(@D); \
fi;
$(abs_builddir)/doc/latex/$(CAP_LIBNAME).pdf: | $(abs_builddir)/doc
cd $(srcdir)/doc; \
if [ -f Makefile ]; then \
make BUILDDIR=$(abs_builddir)/doc latexpdf; \
else \
cp -R latex $(@D); \
fi;
$(abs_builddir)/doc:
mkdir -p $@
doc/%: $(abs_builddir)/doc/%
doc/man/$(LIBNAME).1: $(abs_builddir)/doc/man
doc/texinfo/$(CAP_LIBNAME).info: $(abs_builddir)/doc/texinfo/$(CAP_LIBNAME).info
doc/latex/$(CAP_LIBNAME).pdf: $(abs_builddir)/doc/latex/$(CAP_LIBNAME).pdf
doc: \
$(abs_builddir)/doc/html \
$(abs_builddir)/doc/singlehtml \
$(abs_builddir)/doc/man \
$(abs_builddir)/doc/texinfo/$(CAP_LIBNAME).info \
$(abs_builddir)/doc/latex/$(CAP_LIBNAME).pdf
clean-local:
rm -rf doc
install-data-hook: doc
install -d $(docdir)
install -d $(infodir)
cp -r $(abs_builddir)/doc/html $(docdir)
cp -r $(abs_builddir)/doc/singlehtml $(docdir)
cp -r $(abs_builddir)/doc/texinfo/$(CAP_LIBNAME).info $(infodir)
cp -r $(abs_builddir)/doc/latex/$(CAP_LIBNAME).pdf $(docdir)
endif
ChangeLog:
cd $(srcdir); \
if [ -f git-changelog.sh ]; then \
./git-changelog.sh; \
fi;
uninstall-hook:
rm -rf $(litheincdir)
rm -rf $(docdir)
rm -rf $(infodir)/$(CAP_LIBNAME).info
.PHONY: ChangeLog