1#
2#  Copyright (c) Red Hat Inc., 2008
3#
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.
8#
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.
13#
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
17#
18
19# Author: Masatake YAMATO <yamato@redhat.com>
20# Technique used here is suggested by Garrett Cooper <yanegomi@gmail.com>
21
22# This file does the same things on foo64 system call
23# as compat_16.mk does on foo16. See both compat_16.mk
24# and Makefile for fadvise test case.
25
26CPPFLAGS		+= -I$(abs_srcdir) -I$(abs_srcdir)/../utils
27
28SRCS			?= $(wildcard $(abs_srcdir)/*.c)
29
30MAKE_TARGETS		:= $(notdir $(patsubst %.c,%,$(SRCS)))
31
32ifneq ($(TST_NEWER_64_SYSCALL),no)
33MAKE_TARGETS		+= $(addsuffix _64,$(MAKE_TARGETS))
34endif
35
36# XXX (garrcoop): This code should be put in question as it cannot be applied
37# (no .h file, no TST_USE_NEWER64_SYSCALL def).
38DEF_64			:= TST_USE_NEWER64_SYSCALL
39
40NEWER_64_H		:= $(abs_srcdir)/../utils/newer_64.h
41
42ifneq ($(wildcard $(NEWER_64_H)),)
43HAS_NEWER_64		:= 1
44
45%.c: $(NEWER_64_H)
46
47else
48HAS_NEWER_64		:= 0
49endif
50
51%_64: CFLAGS += -D$(DEF_64)=1
52# XXX (garrcoop): End section of code in question..
53
54%_64.o: %.c
55	$(COMPILE.c) $(OUTPUT_OPTION) $<
56