source: proto/s2k/trunk/demo/grep/src/Makefile @ 3792

Last change on this file since 3792 was 3792, checked in by ksherdy, 5 years ago

Updated Makefile and template.

File size: 1.6 KB
Line 
1SRCFILE=grep.cpp
2S2K_SRCFILE=grep_segment_at_a_time.cpp
3FIXED_PATTERN=apple
4OUTFILE=grep
5TESTDIR=../test/valid
6TESTFILE=../test/valid/fruitlist0.dat
7
8CC= g++ $(CFLAGS)
9CFLAGS= $(SSE) -O3 -std=gnu++0x
10SSE=-msse2 #-msse4.1 -DUSE_PTEST #-mssse3 -msse4.1 -msse4.2
11INCLUDES= -I../lib -I../lib/cc-lib
12
13PAPI_DIR=/usr/local/papi
14
15ARCH=$(shell getconf LONG_BIT)
16ifeq ($(ARCH),32)
17    AFLAGS=-march=pentium4
18    PAPI=-I$(PAPI_DIR)/include -L$(PAPI_DIR)/lib -lpapi -DPAPI -Ilib/cclib
19else
20    AFLAGS=-march=nocona -m64
21    PAPI=-I$(PAPI_DIR)/include -L$(PAPI_DIR)/lib -lpapi -DPAPI -Ilib/cclib
22endif
23
24grep:   $(SRCFILE)
25        $(CC) -o $(OUTFILE) $(SRCFILE) $(INCLUDES) $(AFLAGS) 
26
27s2k_grep: $(S2K_SRCFILE)
28        $(CC) -o $(OUTFILE) $(S2K_SRCFILE) $(INCLUDES) $(AFLAGS) 
29
30test_all: test test_b test_o test_b_o
31
32test: 
33        for file in $(TESTDIR)/*.dat ; do \
34                # echo $$file ; \
35        ./$(OUTFILE) $$file > 0 ; \
36        grep $(FIXED_PATTERN) $$file > 1 ; \
37        diff 0 1 > 2; \
38        done   
39
40test_b: 
41        for file in $(TESTDIR)/*.dat ; do \
42                # echo $$file ; \
43        ./$(OUTFILE) $$file -b > 0 ; \
44        grep $(FIXED_PATTERN) $$file -b > 1 ; \
45        diff 0 1 > 2; \
46        done   
47
48test_o: 
49        for file in $(TESTDIR)/*.dat ; do \
50                # echo $$file ; \
51        ./$(OUTFILE) $$file -o > 0 ; \
52        grep $(FIXED_PATTERN) $$file -o > 1 ; \
53        diff 0 1 > 2; \
54        cat 2 ; \
55        done   
56   
57test_b_o: 
58        for file in $(TESTDIR)/*.dat ; do \
59                # echo $$file ; \
60        ./$(OUTFILE) $$file -o -b > 0 ; \
61        grep $(FIXED_PATTERN) $$file -o -b > 1 ; \
62        diff 0 1 > 2; \
63        done   
64
65clean:
66        rm -f $(OUTFILE) 0 1 2
67
Note: See TracBrowser for help on using the repository browser.