• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Disktest Makefile
3# Copyright (c) International Business Machines Corp., 2001
4#
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19#
20#  Please send e-mail to yardleyb@us.ibm.com if you have
21#  questions or comments.
22#
23#  Project Website:  TBD
24#
25#
26# $Id: Makefile,v 1.13 2009/11/06 20:07:30 vapier Exp $
27# $Log: Makefile,v $
28# Revision 1.13  2009/11/06 20:07:30  vapier
29# drop adding of -O/-W type flags that are already handled in common .mk files
30#
31# for the few makefiles that arent yet converted to the .mk infrastructure:
32# Lately gcc developers introduced -Wextra flag that does the same as -W but is
33# more descriptive. According to this using -W flag should be safe (as gcc is
34# backward compatlible) but using -Wextra is limited to newer gcc releases.
35#
36# Attached patch replaces all -Wextra occurences with -W and thus fixes
37# compliation failures with older gcc (mine was gcc-3.3.3 on sles).
38#
39# patch by Cyril Hrubis
40#
41# Revision 1.12  2009/10/09 17:55:48  yaberauneya
42# 1. Please see README.mk-devel for a full description of the changes
43# from a Make perspective.
44# 2. Several files were changed to accomodate correct installation
45# practices, most notably ones in testcases/network/{ipv6,tcp_cmds},
46# testcases/kernel/sched/hyperthreading/ht_enabled/..., and some items
47# in tools/..., and also to avoid collisions as far as installed
48# testcases (scripts, compiled C apps) were concerned.
49# 3. Several apps weren't autoconf safe and some autoconf tests and
50# conditional statements have been placed in sourcecode and in Makefiles
51# to either a) prevent the tests from being built / installed or b) turn
52# the tests into dummy apps which print out TCONF messages due to
53# lack-of-build support.
54#
55# Signed-off-by: Ngie Cooper <yaneurabeya@gmail.com>
56#
57# Revision 1.11  2008/02/14 08:22:22  subrata_modak
58# Disktest application update to version 1.4.2, by, Brent Yardley <yardleyb@us.ibm.com>
59#
60# Revision 1.31  2008/02/07 15:43:37  yardleyb
61# Applied patch from Mike Frysinger to ensure Makefile properly respect CFLAGS/LDFLAGS
62#
63# Revision 1.30  2006/10/19 20:01:48  yardleyb
64# changes made to support rpm builds
65#
66# Revision 1.29  2006/10/19 17:30:27  yardleyb
67# Added basic signal handling.
68#
69# Revision 1.28  2006/05/12 19:44:47  yardleyb
70# added CHANGELOG to distro
71# uninstall does not force a build
72#
73# Revision 1.27  2005/10/12 23:13:35  yardleyb
74# Updates to code to support new function in disktest version 1.3.x.
75# Actual changes are recorded in the README
76#
77# Revision 1.26  2004/12/18 06:13:03  yardleyb
78# Updated timer schema to more accurately use the time options.  Added
79# fsync on write option to -If.
80#
81# Revision 1.25  2004/12/17 06:34:56  yardleyb
82# removed -mf -ml.  These mark options cause to may issues when using
83# random block size transfers.  Fixed -ma option for endian-ness.  Fixed
84# false data misscompare during multiple cycles.
85#
86# Revision 1.24  2004/11/20 04:43:42  yardleyb
87# Minor code fixes.  Checking for alloc errors.
88#
89# Revision 1.23  2004/11/19 21:45:12  yardleyb
90# Fixed issue with code added for -F option.  Cased disktest
91# to SEG FAULT when cleaning up threads.
92#
93# Revision 1.22  2004/11/19 03:47:45  yardleyb
94# Fixed issue were args data was not being copied from a
95# clean source.
96#
97# Revision 1.21  2004/11/02 20:47:13  yardleyb
98# Added -F functions.
99# lots of minor fixes. see README
100#
101# Revision 1.20  2003/09/12 21:23:56  yardleyb
102# Updated version to 1.12
103#
104# Revision 1.19  2003/01/13 21:33:31  yardleyb
105# Added code to detect AIX volume size.
106# Updated mask for random LBA to use start_lba offset
107# Updated version to 1.1.10
108#
109# Revision 1.18  2002/05/31 18:48:50  yardleyb
110# Updated version to 1.1.9
111#
112# Revision 1.17  2002/04/24 01:59:45  yardleyb
113# Update to version v1.1.3
114#
115# Revision 1.16  2002/04/02 00:11:04  yardleyb
116# Corrected -D for each OS type
117#
118# Revision 1.15  2002/04/01 20:05:26  yardleyb
119# Modified Makefiles for linux,
120# Created Makefiles for windows/aix
121#
122# Revision 1.14  2002/03/07 03:38:52  yardleyb
123# Added dump function from command
124# line.  Created formatted dump output
125# for Data miscomare and command line.
126# Can now leave off filespec the full
127# path header as it will be added based
128# on -I.
129#
130# Revision 1.13  2002/02/28 04:25:45  yardleyb
131# reworked threading code
132# made locking code a macro.
133#
134# Revision 1.12  2002/02/26 19:35:59  yardleyb
135# Updates to parsing routines for user
136# input.  Added multipliers for -S and
137# -s command line arguments. Forced
138# default seeks to default if performing
139# a diskcache test.
140#
141# Revision 1.11  2002/02/21 21:42:15  yardleyb
142# Updated distro for man1
143#
144# Revision 1.10  2002/02/21 21:34:16  yardleyb
145# Cleaned up make dependancies
146# added install and uninstall
147#
148# Revision 1.9  2002/02/21 01:00:50  yardleyb
149# Added README and directory
150# structure to distro
151#
152# Revision 1.8  2002/02/19 02:46:37  yardleyb
153# Added changes to compile for AIX.
154# Update getvsiz so it returns a -1
155# if the ioctl fails and we handle
156# that fact correctly.  Added check
157# to force vsiz to always be greater
158# then stop_lba.
159#
160# Revision 1.7  2001/12/04 19:00:33  yardleyb
161# Updated to add new files and
162# filename changes
163#
164# Revision 1.6  2001/10/10 00:17:14  yardleyb
165# Added Copyright and GPL license text.
166# Miner bug fixes throughout text.
167#
168# Revision 1.5  2001/09/22 03:29:51  yardleyb
169# Added dependence on main.o for sfunc.h usage.h header files
170#
171# Revision 1.4  2001/09/10 22:14:27  yardleyb
172# Added clean up for tar file. Included man page in distro
173#
174# Revision 1.3  2001/09/06 18:23:30  yardleyb
175# Added duty cycle -D.  Updated usage. Added
176# make option to create .tar.gz of all files
177#
178# Revision 1.2  2001/09/05 22:44:42  yardleyb
179# Split out some of the special functions.
180# added O_DIRECT -Id.  Updated usage.  Lots
181# of clean up to functions.  Added header info
182# to pMsg.
183#
184# Revision 1.1  2001/09/04 19:28:07  yardleyb
185# Split usage out. Split header out.  Added usage text.
186# Made signal handler one function. code cleanup.
187#
188
189# 1. -D_LARGE_FILES is used in AIX to support 64bit functions and data types.
190# 2. For Linux:
191#     i.  -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 is used in to support
192#         64-bit functions and data types.
193#     ii. -D_GNU_SOURCE is to support Linux O_DIRECT.
194#
195#    i. and ii. are typically taken from rpm, but, if not, are defined here.
196#
197
198top_srcdir	?= ../../../..
199
200include $(top_srcdir)/include/mk/env_pre.mk
201
202VER		:= `grep VER_STR $(abs_srcdir)/main.h | awk -F\" '{print $$2}'`
203
204CPPFLAGS	+= -DLINUX -D_THREAD_SAFE -D_GNU_SOURCE -D_LARGE_FILES -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(RPM_OPT_FLAGS)
205
206DISTRO_FILES	:= Makefile* *.[ch] LICENSE README CHANGELOG
207
208LDLIBS		+= -lpthread
209
210MAKE_TARGETS	:= disktest
211
212OBJS		:= $(patsubst $(abs_srcdir)/%.c,%.o,$(wildcard $(abs_srcdir)/*.c))
213
214disktest-$(VER):
215	mkdir -p "$@"
216
217disktest: $(OBJS)
218	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION)
219
220all-clean: clean
221	$(RM) -rf *~ *tar* *zip* disktest-$(VER)
222
223distro: all-clean | disktest-$(VER)
224	mkdir -p disktest-$(VER)/man1
225	cp $(addprefix $(abs_srcdir)/,$(DISTRO_FILES)) disktest-$(VER)/.
226	install -m 00444 $(abs_srcdir)/man1/disktest.1 disktest-$(VER)/man1
227	gzip disktest-$(VER)/man1/disktest.1
228	tar -cvzf disktest-$(VER).tar.gz disktest-$(VER)
229
230include $(top_srcdir)/include/mk/generic_leaf_target.mk
231