Skip to content

Commit

Permalink
Improve makefile
Browse files Browse the repository at this point in the history
* Makefile: Add SOEXT, rename xapian-lite.so.stdaln to standlone.
  • Loading branch information
casouri committed Dec 8, 2022
1 parent 554d444 commit 0de1e08
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
.POSIX:
PREFIX ?= /usr/local
CXX ?= g++
CXXFLAGS = -fPIC -I$(PREFIX)/include -std=c++11 -stdlib=libc++
CXXFLAGS = -fPIC -I$(PREFIX)/include -std=c++11
LDFLAGS = -L$(PREFIX)/lib
LDLIBS = -lxapian

xapian-lite.so: xapian-lite.cc
# Dylib extensions.
ifeq ($(OS),Windows_NT)
SOEXT = dll
else ifeq ($(shell uname),Darwin)
SOEXT = dylib
else
SOEXT = so
endif

xapian-lite.$(SOEXT): xapian-lite.cc
$(CXX) $< -o $@ -shared $(CXXFLAGS) $(LDFLAGS) $(LDLIBS)

xapian-lite.so.stdaln: xapian-lite.cc
$(CXX) -o xapian-lite.so -shared $(CXXFLAGS) $< libxapian.a -lz
standalone: xapian-lite.cc
$(CXX) -o xapian-lite.$(SOEXT) -shared $(CXXFLAGS) $< libxapian.a -lz

clean:
rm -f *.so *.o

0 comments on commit 0de1e08

Please sign in to comment.