~snowball-yiddish-dev/snowball-yiddish/trunk

« back to all changes in this revision

Viewing changes to snowball/GNUmakefile

  • Committer: richard
  • Date: 2003-03-30 12:08:09 UTC
  • Revision ID: svn-v4:633ccae0-01f4-0310-8c99-d3591da6f01f:trunk:216
This module will contain only the code and build system, and documentation
for building and running the stemming library.
All sample data will be in a separate module, and the website will be in
its own module too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- makefile -*-
 
2
 
 
3
languages=english porter
 
4
 
 
5
COMPILER_SOURCES = compiler/space.c \
 
6
                   compiler/sort.c \
 
7
                   compiler/tokeniser.c \
 
8
                   compiler/analyser.c \
 
9
                   compiler/generator.c \
 
10
                   compiler/driver.c \
 
11
                   compiler/generator_java.c
 
12
COMPILER_HEADERS = compiler/header.h \
 
13
                   compiler/syswords \
 
14
                   compiler/syswords2
 
15
 
 
16
RUNTIME_SOURCES  = runtime/api.c \
 
17
                   runtime/utilities.c
 
18
RUNTIME_HEADERS  = runtime/api.h \
 
19
                   runtime/header.h
 
20
 
 
21
MKMODULES_SOURCES = libstemmer/mkmodules.c
 
22
 
 
23
LIBSTEMMER_SOURCES = libstemmer/libstemmer.c \
 
24
                     libstemmer/modules.h
 
25
 
 
26
STEMWORDS_SOURCES = examples/stemwords.c
 
27
 
 
28
COMPILER_OBJECTS=$(COMPILER_SOURCES:.c=.o)
 
29
RUNTIME_OBJECTS=$(RUNTIME_SOURCES:.c=.o)
 
30
MKMODULES_OBJECTS=$(MKMODULES_SOURCES:.c=.o)
 
31
LIBSTEMMER_OBJECTS=$(LIBSTEMMER_SOURCES:.c=.o)
 
32
STEMWORDS_OBJECTS=$(STEMWORDS_SOURCES:.c=.o)
 
33
 
 
34
CFLAGS=-Ilibstemmer
 
35
 
 
36
all: snowball libstemmer.o stemwords
 
37
 
 
38
clean:
 
39
        rm -f $(COMPILER_OBJECTS) $(RUNTIME_OBJECTS) $(MKMODULES_OBJECTS) \
 
40
              $(LIBSTEMMER_OBJECTS) $(STEMWORDS_OBJECTS) snowball mkmodules \
 
41
              libstemmer.o stemwords libstemmer/modules.h snowball.splint
 
42
 
 
43
snowball: $(COMPILER_OBJECTS)
 
44
        $(CC) -o $@ $^
 
45
 
 
46
mkmodules: $(MKMODULES_SOURCES)
 
47
        $(CC) -o $@ $^
 
48
 
 
49
libstemmer/modules.h: mkmodules
 
50
        ./mkmodules $@ $(languages)
 
51
 
 
52
libstemmer/libstemmer.o: libstemmer/modules.h
 
53
 
 
54
libstemmer.o: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(languages:=/stem.o)
 
55
        $(AR) -cru $@ $^
 
56
 
 
57
stemwords: $(STEMWORDS_OBJECTS) libstemmer.o
 
58
        $(CC) -o $@ $^
 
59
 
 
60
%/stem.c: %/stem.sbl snowball
 
61
        @l=`echo "$<" | sed 's!\(.*\)/stem.sbl$$!\1!;s!^.*/!!'`; \
 
62
        ./snowball $< -o $${l}/stem -eprefix $${l}_
 
63
 
 
64
%/stem.o: %/stem.c %/stem.h
 
65
        $(CC) $(CFLAGS) -O4 -c -o $@ -I runtime/ $<
 
66
 
 
67
splint: snowball.splint
 
68
snowball.splint: $(COMPILER_SOURCES)
 
69
        splint $^ >$@ -weak