aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/makefile
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-05-17 11:43:22 +1000
committerNeil <nyamatongwe@gmail.com>2020-05-17 11:43:22 +1000
commita52099f81c03f5f4e547c2f15f64b22cee59538a (patch)
tree72af2da2996acbfc582b3d740050289217db1598 /gtk/makefile
parentfdb6d781a14befca446ddb99e78fbb582ef26f77 (diff)
downloadscintilla-mirror-a52099f81c03f5f4e547c2f15f64b22cee59538a.tar.gz
Produce a shared object libscintilla.so that can be dynamically linked to.
Does not include lexers. Separate targets added for shared and static libraries.
Diffstat (limited to 'gtk/makefile')
-rw-r--r--gtk/makefile31
1 files changed, 27 insertions, 4 deletions
diff --git a/gtk/makefile b/gtk/makefile
index 00f902517..0c646e9bb 100644
--- a/gtk/makefile
+++ b/gtk/makefile
@@ -7,7 +7,7 @@
# Builds for GTK+ 2 and 3. GTK 3 requires GTK3=1 on command line.
# Also works with ming32-make on Windows.
-.PHONY: all clean analyze depend
+.PHONY: static shared all clean analyze depend
.SUFFIXES: .cxx .c .o .h .a .list
@@ -49,11 +49,16 @@ ifndef windir
BASE_FLAGS += -fPIC
endif
+LDFLAGS += -dynamiclib
+LDFLAGS += -shared
+
# Take care of changing Unix style '/' directory separator to '\' on Windows
normalize = $(if $(windir),$(subst /,\,$1),$1)
PYTHON = $(if $(windir),pyw,python3)
+SHAREDEXTENSION = $(if $(windir),dll,so)
+
ifdef windir
CC = gcc
DEL = del /q
@@ -61,6 +66,7 @@ else
DEL = rm -f
endif
COMPLIB=$(basedir)/bin/scintilla.a
+COMPONENT=$(basedir)/bin/libscintilla.$(SHAREDEXTENSION)
vpath %.h $(srcdir) $(basedir)/src $(basedir)/include $(basedir)/lexlib
vpath %.c $(srcdir)
@@ -81,12 +87,17 @@ CXX_BASE_FLAGS =--std=c++17 $(BASE_FLAGS)
CXX_ALL_FLAGS =$(DEFINES) $(INCLUDES) $(CXX_BASE_FLAGS) $(CONFIG_FLAGS)
CONFIG_FLAGS:=$(shell pkg-config --cflags $(GTK_VERSION))
+CONFIGLIB:=$(shell pkg-config --libs $(GTK_VERSION) gmodule-no-export-2.0)
MARSHALLER=scintilla-marshal.o
-all: $(COMPLIB)
+all: $(COMPLIB) $(COMPONENT)
+
+static: $(COMPLIB)
+
+shared: $(COMPONENT)
clean:
- $(DEL) *.o $(call normalize,$(COMPLIB)) *.plist
+ $(DEL) *.o $(call normalize,$(COMPLIB)) $(call normalize,$(COMPONENT)) *.plist
%.o: %.cxx
$(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -c $<
@@ -154,15 +165,27 @@ LEXLIB_OBJS = \
StyleContext.o \
WordList.o
+LEXLIBL_OBJS = $(LEXLIB_OBJS) CatalogueL.o
+LEXLIBS_OBJS = $(LEXLIB_OBJS) Catalogue.o
+
GTK_OBJS = \
ScintillaBase.o \
PlatGTK.o \
ScintillaGTK.o \
ScintillaGTKAccessible.o
-$(COMPLIB): $(SRC_OBJS) $(LEXLIB_OBJS) $(GTK_OBJS) $(MARSHALLER) $(LEX_OBJS)
+$(COMPLIB): $(SRC_OBJS) $(LEXLIBL_OBJS) $(GTK_OBJS) $(MARSHALLER) $(LEX_OBJS)
$(AR) $(ARFLAGS) $@ $^
$(RANLIB) $@
+$(COMPONENT): $(SRC_OBJS) $(LEXLIBS_OBJS) $(GTK_OBJS) $(MARSHALLER)
+ $(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(CONFIGLIB)
+
+Catalogue.o: Catalogue.cxx
+ $(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -D SCI_LEXER -D SCI_EMPTYCATALOGUE -c $< -o $@
+
+CatalogueL.o: Catalogue.cxx
+ $(CXX) $(CXX_ALL_FLAGS) $(CXXFLAGS) -D SCI_LEXER -c $< -o $@
+
# Automatically generate header dependencies with "make deps"
include deps.mak