Skip to content

Commit

Permalink
Support out-of-source builds.
Browse files Browse the repository at this point in the history
Thanks to Robin Haberkorn.
  • Loading branch information
orbitalquark committed Sep 7, 2024
1 parent 6989da0 commit 8e126f7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,33 @@

.SUFFIXES: .cxx .c .o .h .a

srcdir ?= .
basedir = $(srcdir)/..

AR = ar
CC = gcc
CXX = g++
CXXFLAGS = -std=c++17 -pedantic -DCURSES -DSCI_LEXER -I../include -I../src -Wall
CXX_BASE_FLAGS = -std=c++17 -pedantic -DCURSES -DSCI_LEXER -I$(basedir)/include -I$(basedir)/src -Wall
ifdef DEBUG
CXXFLAGS += -DDEBUG -g
CXX_BASE_FLAGS += -DDEBUG -g
else
CXXFLAGS += -DNDEBUG -Os
CXX_BASE_FLAGS += -DNDEBUG -Os
endif
CURSES_FLAGS =

scintilla = ../bin/scintilla.a
scintilla = $(basedir)/bin/scintilla.a
sci = AutoComplete.o CallTip.o CaseConvert.o CaseFolder.o CellBuffer.o ChangeHistory.o \
CharacterCategoryMap.o CharacterType.o CharClassify.o ContractionState.o DBCS.o Decoration.o \
Document.o EditModel.o Editor.o EditView.o Geometry.o Indicator.o KeyMap.o LineMarker.o \
MarginView.o PerLine.o PositionCache.o RESearch.o RunStyles.o ScintillaBase.o Selection.o \
Style.o UndoHistory.o UniConversion.o UniqueString.o ViewStyle.o XPM.o

vpath %.h ../src ../include
vpath %.cxx ../src
vpath %.h $(srcdir) $(basedir)/src $(basedir)/include
vpath %.cxx $(srcdir) $(basedir)/src

all: $(scintilla)
$(sci) PlatCurses.o ScintillaCurses.o: %.o: %.cxx
$(CXX) $(CXXFLAGS) $(CURSES_FLAGS) -c $<
$(CXX) $(CXX_BASE_FLAGS) $(CXXFLAGS) $(CURSES_FLAGS) -c $<
$(scintilla): $(sci) PlatCurses.o ScintillaCurses.o
$(AR) rc $@ $^
touch $@
Expand Down

0 comments on commit 8e126f7

Please sign in to comment.