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

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

Output grep test fails to stdout.

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        cat 2 ; \
39        done   
40
41test_b: 
42        for file in $(TESTDIR)/*.dat ; do \
43                # echo $$file ; \
44        ./$(OUTFILE) $$file -b > 0 ; \
45        grep $(FIXED_PATTERN) $$file -b > 1 ; \
46        diff 0 1 > 2; \
47        cat 2 ; \
48        done   
49
50test_o: 
51        for file in $(TESTDIR)/*.dat ; do \
52                # echo $$file ; \
53        ./$(OUTFILE) $$file -o > 0 ; \
54        grep $(FIXED_PATTERN) $$file -o > 1 ; \
55        diff 0 1 > 2; \
56        cat 2 ; \
57        done   
58   
59test_b_o: 
60        for file in $(TESTDIR)/*.dat ; do \
61                # echo $$file ; \
62        ./$(OUTFILE) $$file -o -b > 0 ; \
63        grep $(FIXED_PATTERN) $$file -o -b > 1 ; \
64        diff 0 1 > 2; \
65        cat 2 ; \
66        done   
67
68clean:
69        rm -f $(OUTFILE) 0 1 2
70
Note: See TracBrowser for help on using the repository browser.