2 # Copyright (c) International Business Machines Corp., 2001
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12 # the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 include ..
/utils
/cond.mk
22 CFLAGS
+= -I..
/..
/..
/..
/include -Wall
23 LDLIBS
+= -L..
/..
/..
/..
/lib
-lltp
25 check_aio_eventfd
= $(shell \
27 "\#include <libaio.h>\n\
30 io_set_eventfd(NULL, 0); \
32 }" |
$(CC
) -xc
-laio
- > /dev
/null
2>&1 ; \
36 HAS_LIBAIO
= $(call check_header
,libaio.h
)
37 HAS_LIBAIO_EVENTFD
= $(call check_aio_eventfd
)
39 ifeq ($(HAS_LIBAIO_EVENTFD
),yes
)
40 CFLAGS
+= -DHAS_AIO_EVENTFD
44 SRCS
= $(wildcard *.c
)
45 TARGETS
= $(patsubst %.c
, %, $(wildcard *.c
))
48 ifeq ($(HAS_LIBAIO
),no
)
49 @echo
"Note: Libaio is required for eventfd overflow testing.";
51 ifeq ($(HAS_LIBAIO_EVENTFD
),no
)
52 @echo
"Note: Eventfd support is required in libaio for overflow testing.";
57 @set
-e
; for i in
$(TARGETS
); do ln
-f
$$i ..
/..
/..
/bin
/$$i ; done