source: proto/RE/demo/src/Makefile @ 3739

Last change on this file since 3739 was 3739, checked in by ksherdy, 4 years ago

Added support for segment-at-a-time processing. Match strings at follows position.

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