File: Makefile

package info (click to toggle)
tiobench 0.3.2-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 168 kB
  • ctags: 150
  • sloc: ansic: 1,286; perl: 166; makefile: 94; sh: 59
file content (72 lines) | stat: -rw-r--r-- 1,671 bytes parent folder | download
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
# Makefile for tiotest

CC=gcc
#CFLAGS=-O3 -fomit-frame-pointer -Wall
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS = -Wall -g
else
	CFLAGS = -O2 -Wall
endif

#DEFINES=-DUSE_MMAP 
#-DUSE_MADVISE

# This enables support for 64bit file offsets, allowing
# possibility to test with files larger than (2^31) bytes.

#DEFINES=-DLARGEFILES

#DEFINES=

LINK=gcc
EXE=tiotest
PROJECT=tiobench
VERSION=`egrep "tiotest v[0-9]+.[0-9]+" tiotest.c | cut -d " " -f 7 | sed "s/v//g"`
DISTNAME=$(PROJECT)-$(VERSION)
INSTALL=install
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
DOCDIR=/usr/local/doc/$(DISTNAME)

all: $(EXE)

crc32.o: crc32.c crc32.h
	$(CC) -c $(CFLAGS) $(DEFINES) crc32.c -o crc32.o

tiotest.o: tiotest.c tiotest.h crc32.h crc32.c Makefile
	$(CC) -c $(CFLAGS) $(DEFINES) tiotest.c -o tiotest.o

$(EXE): tiotest.o crc32.o
	$(LINK) -o $(EXE) tiotest.o crc32.o -lpthread
	@echo
	@echo "./tiobench.pl --help for usage options"
	@echo

clean:
	rm -f tiotest.o crc32.o $(EXE) core

dist:
	ln -s . $(DISTNAME)
	tar -zcvf $(DISTNAME).tar.gz $(DISTNAME)/*.c $(DISTNAME)/*.h $(DISTNAME)/Makefile $(DISTNAME)/COPYING $(DISTNAME)/README $(DISTNAME)/TODO $(DISTNAME)/ChangeLog $(DISTNAME)/BUGS $(DISTNAME)/tiobench.pl $(DISTNAME)/scripts
	rm $(DISTNAME)

install:
	if [ ! -d $(BINDIR) ]; then \
		mkdir -p $(BINDIR); \
	fi;
	if [ ! -d $(DOCDIR) ]; then \
		mkdir -p $(DOCDIR); \
	fi;
	$(INSTALL) tiotest $(BINDIR)
	$(INSTALL) tiobench.pl $(BINDIR)
	$(INSTALL) README $(DOCDIR)
	$(INSTALL) BUGS $(DOCDIR)
	$(INSTALL) COPYING $(DOCDIR)
	$(INSTALL) ChangeLog $(DOCDIR)
	$(INSTALL) TODO $(DOCDIR)

uninstall:
	rm -f $(BINDIR)/tiotest
	rm -f $(BINDIR)/tiobench.pl
	rm -rf $(DOCDIR)