Makefile revision f7298c78ccec20dbf2f96a83265c38811655241a
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.8 2005/12/05 19:15:19 mridge Exp $
27# $Log: Makefile,v $
28# Revision 1.8  2005/12/05 19:15:19  mridge
29# Updates from Jennifer Monk to enable compiling w/o errors using XLC
30#
31# Revision 1.7  2005/08/02 16:15:52  robbiew
32# Applied patch from Mike Frysinger:
33# find attached a patch to fix up the install target in disktest to match the
34# install targets of everything else
35# -mike
36#
37# Revision 1.6  2005/05/04 17:54:00  mridge
38# Update to version 1.2.8
39#
40# Revision 1.26  2004/12/18 06:13:03  yardleyb
41# Updated timer schema to more accurately use the time options.  Added
42# fsync on write option to -If.
43#
44# Revision 1.25  2004/12/17 06:34:56  yardleyb
45# removed -mf -ml.  These mark options cause to may issues when using
46# random block size transfers.  Fixed -ma option for endian-ness.  Fixed
47# false data misscompare during multiple cycles.
48#
49# Revision 1.24  2004/11/20 04:43:42  yardleyb
50# Minor code fixes.  Checking for alloc errors.
51#
52# Revision 1.23  2004/11/19 21:45:12  yardleyb
53# Fixed issue with code added for -F option.  Cased disktest
54# to SEG FAULT when cleaning up threads.
55#
56# Revision 1.22  2004/11/19 03:47:45  yardleyb
57# Fixed issue were args data was not being copied from a
58# clean source.
59#
60# Revision 1.21  2004/11/02 20:47:13  yardleyb
61# Added -F functions.
62# lots of minor fixes. see README
63#
64# Revision 1.20  2003/09/12 21:23:56  yardleyb
65# Updated version to 1.12
66#
67# Revision 1.19  2003/01/13 21:33:31  yardleyb
68# Added code to detect AIX volume size.
69# Updated mask for random LBA to use start_lba offset
70# Updated version to 1.1.10
71#
72# Revision 1.18  2002/05/31 18:48:50  yardleyb
73# Updated version to 1.1.9
74#
75# Revision 1.17  2002/04/24 01:59:45  yardleyb
76# Update to version v1.1.3
77#
78# Revision 1.16  2002/04/02 00:11:04  yardleyb
79# Corrected -D for each OS type
80#
81# Revision 1.15  2002/04/01 20:05:26  yardleyb
82# Modified Makefiles for linux,
83# Created Makefiles for windows/aix
84#
85# Revision 1.14  2002/03/07 03:38:52  yardleyb
86# Added dump function from command
87# line.  Created formatted dump output
88# for Data miscomare and command line.
89# Can now leave off filespec the full
90# path header as it will be added based
91# on -I.
92#
93# Revision 1.13  2002/02/28 04:25:45  yardleyb
94# reworked threading code
95# made locking code a macro.
96#
97# Revision 1.12  2002/02/26 19:35:59  yardleyb
98# Updates to parsing routines for user
99# input.  Added multipliers for -S and
100# -s command line arguments. Forced
101# default seeks to default if performing
102# a diskcache test.
103#
104# Revision 1.11  2002/02/21 21:42:15  yardleyb
105# Updated distro for man1
106#
107# Revision 1.10  2002/02/21 21:34:16  yardleyb
108# Cleaned up make dependancies
109# added install and uninstall
110#
111# Revision 1.9  2002/02/21 01:00:50  yardleyb
112# Added README and directory
113# structure to distro
114#
115# Revision 1.8  2002/02/19 02:46:37  yardleyb
116# Added changes to compile for AIX.
117# Update getvsiz so it returns a -1
118# if the ioctl fails and we handle
119# that fact correctly.  Added check
120# to force vsiz to always be greater
121# then stop_lba.
122#
123# Revision 1.7  2001/12/04 19:00:33  yardleyb
124# Updated to add new files and
125# filename changes
126#
127# Revision 1.6  2001/10/10 00:17:14  yardleyb
128# Added Copyright and GPL license text.
129# Miner bug fixes throughout text.
130#
131# Revision 1.5  2001/09/22 03:29:51  yardleyb
132# Added dependence on main.o for sfunc.h usage.h header files
133#
134# Revision 1.4  2001/09/10 22:14:27  yardleyb
135# Added clean up for tar file. Included man page in distro
136#
137# Revision 1.3  2001/09/06 18:23:30  yardleyb
138# Added duty cycle -D.  Updated usage. Added
139# make option to create .tar.gz of all files
140#
141# Revision 1.2  2001/09/05 22:44:42  yardleyb
142# Split out some of the special functions.
143# added O_DIRECT -Id.  Updated usage.  Lots
144# of clean up to functions.  Added header info
145# to pMsg.
146#
147# Revision 1.1  2001/09/04 19:28:07  yardleyb
148# Split usage out. Split header out.  Added usage text.
149# Made signal handler one function. code cleanup.
150#
151
152# -D "_LARGE_FILES" is used in AIX to support 64bit functions and data types
153# -D"_LARGEFILE64_SOURCE" -D"_FILE_OFFSET_BITS=64" is used in Linux to support 64bit functions and data types. -D"_GNU_SOURCE" is to support Linux O_DIRECT
154# These are typically taken from rpm, but, if not, defined here.
155bindir=/usr/bin
156libdir=/usr/lib
157sysconfdir=/etc
158mandir=/usr/share/man
159
160VER=`grep VER_STR main.h | awk -F\" '{print $$2}'`
161GBLHDRS=main.h globals.h defs.h
162ALLHDRS=$(wildcard *.h)
163SRCS=$(wildcard *.c)
164OBJS=$(SRCS:.c=.o)
165
166CFLAGS= -g -Wall -O -D"LINUX" -D"_THREAD_SAFE" -D"_GNU_SOURCE" -D"_LARGE_FILES" -D"_LARGEFILE64_SOURCE" -D"_FILE_OFFSET_BITS=64"
167
168all: $(OBJS) disktest
169
170disktest: $(OBJS) $(SRCS) $(ALLHDRS)
171	$(CC) $(CFLAGS) -lpthread -o disktest $(OBJS)
172
173main.o: main.c $(ALLHDRS)
174sfunc.o: sfunc.c sfunc.h $(GBLHDRS)
175parse.o: parse.c parse.h sfunc.h $(GBLHDRS)
176childmain.o: childmain.c childmain.h sfunc.h parse.h threading.h $(GBLHDRS)
177threading.o: threading.c threading.h childmain.h sfunc.h $(GBLHDRS)
178globals.o: globals.c threading.h $(GBLHDRS)
179usage.o: usage.c usage.h
180Getopt.o: Getopt.c Getopt.h
181io.o: io.c io.h $(GBLHDRS)
182dump.o: dump.c dump.h $(GBLHDRS)
183timer.o: timer.c timer.h $(GBLHDRS)
184stats.o: stats.c stats.h $(GBLHDRS)
185
186install: disktest
187	ln -f disktest ../../../bin
188
189clean:
190	rm -f disktest $(OBJS)
191
192all-clean: clean
193	rm -f *~ *tar* *zip*
194
195distro: all-clean
196	mkdir disktest.$(VER)
197	mkdir disktest.$(VER)/man1
198	cp ./Makefile* ./*.[ch] ./LICENSE ./README disktest.$(VER)
199	cp ./man1/disktest.1 disktest.$(VER)/man1
200	chmod 444 disktest.$(VER)/man1/disktest.1
201	gzip disktest.$(VER)/man1/disktest.1
202	tar cvf ./disktest.$(VER).tar disktest.$(VER)
203	rm -rf disktest.$(VER)
204	gzip ./disktest.$(VER).tar
205