Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of #42 used to package for alpine linux #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/libstemmer/modules.h
/libstemmer/modules_utf8.h
/libstemmer.a
/libstemmer.so*
/snowball
/src_c
/stemtest
Expand Down
16 changes: 12 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

# After changing this, run `make update_version` to update various sources
# which hard-code it.
SNOWBALL_VERSION = 2.2.0
MAJOR_VERSION := 2
MINOR_VERSION := 2
PATCH_VERSION := 0
SNOWBALL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)

ifeq ($(OS),Windows_NT)
EXEEXT = .exe
Expand Down Expand Up @@ -170,20 +173,20 @@ C_OTHER_OBJECTS = $(C_OTHER_SOURCES:.c=.o)
JAVA_CLASSES = $(JAVA_SOURCES:.java=.class)
JAVA_RUNTIME_CLASSES=$(JAVARUNTIME_SOURCES:.java=.class)

CFLAGS=-O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations
CFLAGS=-fPIC -O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations
CPPFLAGS=

INCLUDES=-Iinclude

all: snowball$(EXEEXT) libstemmer.a stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
all: snowball$(EXEEXT) libstemmer.a libstemmer.so stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)

algorithms.mk: libstemmer/mkalgorithms.pl libstemmer/modules.txt
libstemmer/mkalgorithms.pl algorithms.mk libstemmer/modules.txt

clean:
rm -f $(COMPILER_OBJECTS) $(RUNTIME_OBJECTS) \
$(LIBSTEMMER_OBJECTS) $(LIBSTEMMER_UTF8_OBJECTS) $(STEMWORDS_OBJECTS) snowball$(EXEEXT) \
libstemmer.a stemwords$(EXEEXT) \
libstemmer.a libstemmer.so libstemmer.so.$(SNOWBALL_VERSION) libstemmer.so.$(MAJOR_VERSION) stemwords$(EXEEXT) \
libstemmer/modules.h \
libstemmer/modules_utf8.h \
$(C_LIB_SOURCES) $(C_LIB_HEADERS) $(C_LIB_OBJECTS) \
Expand Down Expand Up @@ -225,6 +228,11 @@ libstemmer/libstemmer.o: libstemmer/modules.h $(C_LIB_HEADERS)
libstemmer.a: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
$(AR) -cru $@ $^

libstemmer.so: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,$@.$(MAJOR_VERSION),-version-script,libstemmer/symbol.map -o $@.$(SNOWBALL_VERSION) $^
ln -s $@.$(SNOWBALL_VERSION) $@.$(MAJOR_VERSION)
ln -s $@.$(SNOWBALL_VERSION) $@

examples/%.o: examples/%.c
$(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $<

Expand Down
6 changes: 6 additions & 0 deletions libstemmer/symbol.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SB_STEMMER_0 {
global:
sb_stemmer_*;
local:
*;
};