Skip to content

Instantly share code, notes, and snippets.

@aviks
Created March 23, 2020 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aviks/7c1951c92fe16ec9e86d12b93b38d8e6 to your computer and use it in GitHub Desktop.
Save aviks/7c1951c92fe16ec9e86d12b93b38d8e6 to your computer and use it in GitHub Desktop.
Snowball-Makefile
include mkinc.mak
CFLAGS=-O2
CPPFLAGS=-Iinclude
all: libstemmer.$(dlext) libstemmer.o stemwords$(exeext)
$(bindir):
mkdir -p $(bindir)
$(libdir):
mkdir -p $(libdir)
libstemmer.o: $(snowball_sources:.c=.o)
$(AR) -cru $@ $^
libstemmer.$(dlext): libstemmer.o
$(CC) -shared $(CFLAGS) -o $@ $(LDFLAGS) $^
stemwords$(exeext): examples/stemwords.o libstemmer.o
$(CC) $(CFLAGS) -o $@ $^
install-libstemmer: $(libdir) libstemmer.$(dlext)
cp libstemmer.$(dlext) $(libdir)/
install-stemwords: $(bindir) stemwords$(exeext)
cp stemwords$(exeext) $(bindir)/
install: install-stemwords install-libstemmer
clean:
rm -rf libstemmer.so stemwords *.o src_c/*.o examples/*.o runtime/*.o libstemmer/*.o $(bindir) $(libdir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment