updated on Sat Jan 14 12:12:45 UTC 2012
[aur-mirror.git] / nbench-byte / Makefile
blobe37f1962a8300b35c0d62c6ae408675d3984c309
1 # Makefile for nbench, December 11, 1997, Uwe F. Mayer <mayer@tux.org>
2 # Updated February 18, 2003
4 default: nbench
6 ##########################################################################
7 # If you are using gcc-2.7.2.3 or earlier:
8 # The optimizer of gcc has a bug and in general you should not specify
9 # -funroll-loops together with -O (or -O2, -O3, etc.)
10 # This bug is supposed to be fixed with release 2.8 of gcc.
12 # This bug does NOT seem to have an effect on the correct compilation
13 # of this benchmark suite on my Linux box. However, it leads to
14 # the dreaded "internal compiler error" message on our alpha
15 # running DEC Unix 4.0b. The Linux-binary that was used to obtain
16 # the baseline results was nevertheless compiled with
17 # CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops
19 # You should leave -static in the CFLAGS so that your sysinfo can be
20 # compiled into the executable.
22 CC = gcc
24 # generic options for gcc
25 #CFLAGS = -s -static -Wall -O3
26 CFLAGS = -Wall -O2
28 # if your gcc lets you do it, then try this one
29 #CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops
31 # for gcc on an older Pentium type processor you can try the following
32 #CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -m486 \
33 # -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \
34 # -falign-jumps=2 -funroll-loops
36 # for a newer gcc on a newer Pentium type processor you can try the following
37 #CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -march=i686 \
38 # -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \
39 # -falign-jumps=2 -funroll-loops
41 # for a newer gcc on an Athlon XP type processor you can try the following
42 #CFLAGS = -s -static -O3 -fomit-frame-pointer -Wall -march=athlon-xp \
43 # -fforce-addr -fforce-mem -falign-loops=2 -falign-functions=2 \
44 # -falign-jumps=2 -funroll-loops
46 # For debugging using gcc
47 #CFLAGS = -g -O3 -Wall -DDEBUG
49 ##########################################################################
50 # For Linux machines with more than one binary format.
51 # The default binaries, depends on your system whether it's elf or aout.
52 MACHINE=
53 # a.out code for linux on an elf machine
54 #MACHINE= -bi486-linuxaout
55 # elf code for linux on an a.out machine
56 #MACHINE= -bi486-linuxelf
57 # if you want a different compiler version and different binaries, for example
58 #MACHINE= -V2.7.2 -bi486-linuxaout
60 ##########################################################################
61 # Read the file README.nonlinux if you are not using Linux
63 # for DEC Unix using cc you can try
64 #CC = cc
65 #CFLAGS = -O3
66 #LINKFLAGS = -s -non_shared
68 # for SunOS using cc
69 #CC = cc
70 #CFLAGS = -O3 -s
72 # for DEC Ultrix using cc
73 #CC = cc
74 #CFLAGS = -O2
75 #LINKFLAGS = -s
77 # for a Mac with OsX and the Darwin environment
78 #CC = cc
79 #CFLAGS = -O3 -DOSX
81 # For debugging using cc
82 #CC = cc
83 #CFLAGS = -g -DDEBUG
85 ##########################################################################
86 # If your system does not understand the system command "uname -s -r"
87 # then comment this out
89 # NO_UNAME= -DNO_UNAME
91 ##########################################################################
92 # For any Unix flavor you need -DLINUX
93 # You also need -DLINUX to get the new indices
95 DEFINES= -DLINUX $(NO_UNAME)
97 ##########################################################################
98 # For LINUX-like systems with gcc
99 sysinfoc.c: Makefile
100 ./sysinfo.sh $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)
102 sysinfo.c: Makefile
103 ./sysinfo.sh $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)
105 ##########################################################################
106 # For non-LINUX systems
107 # Edit the files sysinfo.c and sysinfoc.c to include your system information
108 # and take sysinfo.c and sysinfoc.c out of the dependencies for nbench0.o
110 hardware.o: hardware.c hardware.h Makefile
111 $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
112 -c hardware.c
114 nbench0.o: nbench0.h nbench0.c nmglobal.h pointer.h hardware.h\
115 Makefile sysinfo.c sysinfoc.c
116 $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
117 -c nbench0.c
119 emfloat.o: emfloat.h emfloat.c nmglobal.h pointer.h Makefile
120 $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
121 -c emfloat.c
123 pointer.h: pointer Makefile
124 $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
125 -o pointer pointer.c
126 rm -f pointer.h
127 if [ "4" = `./pointer` ] ; then touch pointer.h ;\
128 else echo "#define LONG64" >pointer.h ; fi
130 misc.o: misc.h misc.c Makefile
131 $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
132 -c misc.c
134 nbench1.o: nbench1.h nbench1.c wordcat.h nmglobal.h pointer.h Makefile
135 $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
136 -c nbench1.c
138 sysspec.o: sysspec.h sysspec.c nmglobal.h pointer.h Makefile
139 $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
140 -c sysspec.c
142 nbench: emfloat.o misc.o nbench0.o nbench1.o sysspec.o hardware.o
143 $(CC) $(MACHINE) $(DEFINES) $(CFLAGS) $(LINKFLAGS)\
144 emfloat.o misc.o nbench0.o nbench1.o sysspec.o hardware.o\
145 -o nbench -lm
147 ##########################################################################
149 clean:
150 - /bin/rm -f *.o *~ \#* core a.out hello sysinfo.c sysinfoc.c \
151 bug pointer pointer.h debugbit.dat
153 mrproper: clean
154 - /bin/rm -f nbench