summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-11 22:34:57 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-11 22:34:57 +0000
commit1fa9357768c1b4b2301b7341656dbc81e531c9f6 (patch)
tree09866b6fc5eb52f13a44228fbbd7be543131942f /Makefile
parent9e43555ab77b3a486948f2de4a878cc0d6d0c275 (diff)
-- Split nbench1.c into component files
-- Combine wordcat.h with huffman routines in huffman.c -- Readd NNET.DAT (oops) -- Update Makefile to build component files git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@3 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile129
1 files changed, 85 insertions, 44 deletions
diff --git a/Makefile b/Makefile
index 5045c77..311e55d 100644
--- a/Makefile
+++ b/Makefile
@@ -19,10 +19,16 @@ default: nbench
# You should leave -static in the CFLAGS so that your sysinfo can be
# compiled into the executable.
-CC = gcc
+CCC=gcc
+GCC=gcc
# generic options for gcc
-CFLAGS = -s -static -Wall -O3
+#CFLAGS=-O3 -mcpu=ev67 -mieee -funroll-loops -ftree-vectorize -fprefetch-loop-arrays -pipe -static -msmall-data -msmall-text
+#CFLAGS=-O3 -mcpu=ev67 -mieee -pipe -msmall-data -msmall-text -funroll-loops -ftree-vectorize -static
+GCCFLAGS=-O3 -march=k8 -msse3 -ftree-vectorize -funroll-loops -pipe
+#CCCFLAGS=-fast -unroll 0 -inline speed
+CCCFLAGS=${GCCFLAGS}
+LINKFLAGS=
# if your gcc lets you do it, then try this one
#CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops
@@ -91,15 +97,15 @@ MACHINE=
# For any Unix flavor you need -DLINUX
# You also need -DLINUX to get the new indices
-DEFINES= -DLINUX $(NO_UNAME)
+DEFINES=$(NO_UNAME) -DLINUX
##########################################################################
# For LINUX-like systems with gcc
sysinfoc.c: Makefile
- ./sysinfo.sh $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)
+ ./sysinfo.sh $(GCC) $(DEFINES) $(GCCFLAGS)
sysinfo.c: Makefile
- ./sysinfo.sh $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)
+ ./sysinfo.sh $(GCC) $(DEFINES) $(GCCFLAGS)
##########################################################################
# For non-LINUX systems
@@ -107,47 +113,82 @@ sysinfo.c: Makefile
# and take sysinfo.c and sysinfoc.c out of the dependencies for nbench0.o
hardware.o: hardware.c hardware.h Makefile
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
- -c hardware.c
-
-nbench0.o: nbench0.h nbench0.c nmglobal.h pointer.h hardware.h\
- Makefile sysinfo.c sysinfoc.c
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
- -c nbench0.c
-
-emfloat.o: emfloat.h emfloat.c nmglobal.h pointer.h Makefile
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
- -c emfloat.c
-
-pointer.h: pointer Makefile
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
- -o pointer pointer.c
- rm -f pointer.h
- if [ "4" = `./pointer` ] ; then touch pointer.h ;\
- else echo "#define LONG64" >pointer.h ; fi
-
-misc.o: misc.h misc.c Makefile
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
- -c misc.c
-
-nbench1.o: nbench1.h nbench1.c wordcat.h nmglobal.h pointer.h Makefile
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
- -c nbench1.c
-
-sysspec.o: sysspec.h sysspec.c nmglobal.h pointer.h Makefile
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
- -c sysspec.c
-
-nbench: emfloat.o misc.o nbench0.o nbench1.o sysspec.o hardware.o
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS) $(LINKFLAGS)\
- emfloat.o misc.o nbench0.o nbench1.o sysspec.o hardware.o\
- -o nbench -lm
+ $(GCC) $(DEFINES) $(GCCFLAGS) -c hardware.c
+
+nbench0.o: nbench0.h nbench0.c nmglobal.h hardware.h Makefile sysinfo.c sysinfoc.c
+ $(GCC) $(DEFINES) $(GCCFLAGS) -c nbench0.c
+# Segfault before first test
+
+emfloat.o: emfloat.h emfloat.c nmglobal.h Makefile
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c emfloat.c
+
+misc.o: misc.c Makefile
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c misc.c
+
+numsort.o: numsort.c
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c numsort.c
+# gcc - 2.95
+# ccc - 5.08
+
+stringsort.o: stringsort.c
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c stringsort.c
+# gcc - 6.77
+# ccc - 7.24
+
+bitfield.o: bitfield.c
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c bitfield.c
+# gcc - 4.93, 4.90, 4.93, 4.93
+# ccc - 4.79, 4.85, 4.81,
+
+fpemulation.o: fpemulation.c
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c fpemulation.c
+# gcc - 13.90
+# ccc - 13.90
+
+fourier.o: fourier.c
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c fourier.c
+# gcc - 15.96
+# ccc - 19.30
+
+assignment.o: assignment.c
+ $(GCC) $(DEFINES) $(GCCFLAGS) -c assignment.c
+# gcc - 16.51
+# ccc - 7.98
+
+idea.o: idea.c
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c idea.c
+# gcc - 8.79
+# ccc - 9.10
+
+huffman.o: huffman.c
+ $(GCC) $(DEFINES) $(GCCFLAGS) -c huffman.c
+# $(CCC) $(DEFINES) -O1 -host -unroll 0 -inline speed -c huffman.c -g3
+# $(CCC) $(DEFINES) $(CCCFLAGS) -c huffman.c -g3
+# gcc - 6.94
+# ccc - segfault
+# ccc -O1 -host - 5.14
+# ccc -O2 -host - segfault
+# ccc -O1 -host -unroll 0 -inline speed - 5.95
+
+neural.o: neural.c
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c neural.c
+# gcc - 12.00
+# ccc - 14.20
+
+linear.o: linear.c
+ $(CCC) $(DEFINES) $(CCCFLAGS) -c linear.c
+# gcc - 16.38
+# ccc - 23.29
+
+sysspec.o: sysspec.h sysspec.c nmglobal.h Makefile
+ $(GCC) $(DEFINES) $(GCCFLAGS) -c sysspec.c
+
+nbench: emfloat.o misc.o nbench0.o numsort.o sysspec.o hardware.o stringsort.o bitfield.o fpemulation.o fourier.o assignment.o idea.o huffman.o neural.o linear.o
+ $(GCC) emfloat.o misc.o nbench0.o numsort.o sysspec.o hardware.o stringsort.o bitfield.o fpemulation.o fourier.o assignment.o idea.o huffman.o neural.o linear.o -o nbench -lm
##########################################################################
clean:
- - /bin/rm -f *.o *~ \#* core a.out hello sysinfo.c sysinfoc.c \
- bug pointer pointer.h debugbit.dat
+ - /bin/rm -f *.o nbench sysinfo.c sysinfoc.c
-mrproper: clean
- - /bin/rm -f nbench
+remake: clean nbench