From 5f4fbc763a90a38508a0a7d4f4ae7a2262ecbd39 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 25 Apr 2018 22:52:33 -0400 Subject: Removed LuaJIT version of Textadept. Also updated to Lua 5.3 syntax where held back by LuaJIT's 5.1/5.2 syntax. --- src/Makefile | 115 ++++++++++++++--------------------------------------------- 1 file changed, 27 insertions(+), 88 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 4941a1b0..c370ffc7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,14 +34,13 @@ ifeq (win, $(findstring win, $(MAKECMDGOALS))) CURSES_CFLAGS = -DLIBICONV_STATIC -Iwin32curses/include CURSES_LIBS = win32curses/lib/pdcurses.a win32curses/lib/libiconv.a endif - libluajit = luajit/src/lua51.dll else ifeq (osx, $(findstring osx, $(MAKECMDGOALS))) # Cross-compile for Mac OSX. CROSS = x86_64-apple-darwin9- CFLAGS += -mdynamic-no-pic CXXFLAGS += -mdynamic-no-pic LUA_CFLAGS = -DLUA_USE_MACOSX - LDFLAGS = -liconv -Wl,-read_only_relocs,suppress + LDFLAGS = -liconv ifeq (, $(findstring curses, $(MAKECMDGOALS))) plat_flag = -DGTK GTK_CFLAGS = $(shell PKG_CONFIG_PATH=`pwd`/gtkosx/lib/pkgconfig \ @@ -58,7 +57,6 @@ else ifeq (osx, $(findstring osx, $(MAKECMDGOALS))) plat_flag = -DCURSES CURSES_LIBS = -lncurses endif - libluajit = luajit/src/libluajit.osx.a else # Build for Linux/BSD. LUA_CFLAGS = -DLUA_USE_LINUX @@ -88,7 +86,7 @@ else GTK_LIBS = $(shell pkg-config --libs gtk+-3.0 gmodule-2.0) endif GLIB_CFLAGS = $(shell pkg-config --cflags glib-2.0) - install_targets = ../textadept ../textadeptjit + install_targets = ../textadept else plat_flag = -DCURSES CURSES_CFLAGS = $(shell pkg-config --silence-errors --cflags ncursesw || \ @@ -98,9 +96,8 @@ else pkg-config --silence-errors --libs ncurses || \ pkg-config --silence-errors --libs curses || \ echo -lncursesw) - install_targets = ../textadept-curses ../textadeptjit-curses + install_targets = ../textadept-curses endif - libluajit = luajit/src/libluajit.a endif # Scintilla. @@ -117,7 +114,7 @@ sci_objs = AutoComplete.o CallTip.o CaseConvert.o CaseFolder.o Catalogue.o \ sci_lex_objs = Accessor.o CharacterCategory.o CharacterSet.o LexerBase.o \ LexerModule.o LexerNoExceptions.o LexerSimple.o PropSetSimple.o \ StyleContext.o WordList.o -sci_lexer_objs = LexLPeg.o LexLPegjit.o LexLPeg-curses.o LexLPegjit-curses.o +sci_lexer_objs = LexLPeg.o LexLPeg-curses.o sci_gtk_objs = PlatGTK.o ScintillaGTK.o ScintillaGTKAccessible.o sci_curses_objs = ScintillaCurses.o @@ -125,8 +122,8 @@ sci_curses_objs = ScintillaCurses.o ta_flags = -std=c99 -pedantic $(plat_flag) -Iscintilla/include -Igtdialog -Wall -textadept_gtk_objs = textadept.o textadeptjit.o -textadept_curses_objs = textadept-curses.o textadeptjit-curses.o +textadept_gtk_objs = textadept.o +textadept_curses_objs = textadept-curses.o textadept_objs = $(textadept_gtk_objs) $(textadept_curses_objs) lua_objs = lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o \ linit.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o \ @@ -134,9 +131,7 @@ lua_objs = lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o \ lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \ lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o lua_lib_objs = lpcap.o lpcode.o lpprint.o lptree.o lpvm.o lfs.o -luajit_lib_objs = lpcapjit.o lpcodejit.o lpprintjit.o lptreejit.o lpvmjit.o \ - lfsjit.o lutf8libjit.o -lua_spawn_objs = lspawn.o lspawnjit.o lspawn-curses.o lspawnjit-curses.o +lua_spawn_objs = lspawn.o lspawn-curses.o gtdialog_objs = gtdialog.o gtdialog-curses.o termkey_unix_objs = driver-ti.o driver-csi.o termkey_win32_objs = driver-win32-pdcurses.o @@ -154,12 +149,12 @@ endif # Build. -all: textadept textadeptjit -curses: textadept-curses textadeptjit-curses -win32: textadept.exe textadeptjit.exe -win32-curses: textadept-curses.exe textadeptjit-curses.exe -osx: textadept textadeptjit -osx-curses: textadept-curses textadeptjit-curses +all: textadept +curses: textadept-curses +win32: textadept.exe +win32-curses: textadept-curses.exe +osx: textadept +osx-curses: textadept-curses $(sci_objs): %.o: scintilla/src/%.cxx $(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) $< -o $@ @@ -179,17 +174,9 @@ $(lua_objs): %.o: lua/src/%.c $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -ULUA_LIB $< -o $@ $(lua_lib_objs): %.o: lua/src/lib/%.c $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) $< -o $@ -$(luajit_lib_objs): %jit.o: lua/src/lib/%.c - $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) $< -o $@ $(lua_spawn_objs): lua/src/lib/lspawn.c $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -std=c99 -pedantic $(spawn_flags) \ $< -o $@ -luajit/src/libluajit.a: ; $(MAKE) -C luajit CC="$(CC)" CFLAGS="$(CFLAGS)" -luajit/src/lua51.dll: - $(MAKE) -C luajit HOST_CC="$(CC) -m32" CROSS=$(CROSS) TARGET_SYS=Windows \ - TARGET_SHLDFLAGS="-static-libgcc" -luajit/src/libluajit.osx.a: - $(MAKE) -C luajit CROSS=$(CROSS) TARGET_SYS=Darwin LUAJIT_A=$(notdir $@) $(gtdialog_objs): gtdialog/gtdialog.c $(CROSS)$(CC) -c $(CFLAGS) -std=c99 -pedantic $(plat_flag) -DNOHELP \ -DLIBRARY $(gtdialog_flags) $< -o $@ @@ -202,23 +189,16 @@ textadept_rc.o: textadept.rc ; $(CROSS)$(WINDRES) $< $@ # Target-specific variables. -LexLPeg-curses.o LexLPegjit-curses.o: sci_flags += -DCURSES $(CURSES_CFLAGS) +LexLPeg-curses.o: sci_flags += -DCURSES $(CURSES_CFLAGS) lua_dep_objs = LexLPeg.o LexLPeg-curses.o textadept.o textadept-curses.o \ $(lua_objs) $(lua_lib_objs) lspawn.o lspawn-curses.o -luajit_dep_objs = LexLPegjit.o LexLPegjit-curses.o textadeptjit.o \ - textadeptjit-curses.o $(luajit_lib_objs) lspawnjit.o \ - lspawnjit-curses.o $(lua_dep_objs): LUA_CFLAGS += -Ilua/src -$(luajit_dep_objs): LUA_CFLAGS += -Iluajit/src $(textadept_gtk_objs): ta_flags += $(GTK_CFLAGS) $(textadept_curses_objs): \ ta_flags += -Iscintilla/curses -Itermkey -Icdk $(CURSES_CFLAGS) -lspawn.o lspawnjit.o: spawn_flags = -DGTK $(GLIB_CFLAGS) +lspawn.o: spawn_flags = -DGTK $(GLIB_CFLAGS) gtdialog.o: gtdialog_flags += $(GTK_CFLAGS) gtdialog-curses.o: gtdialog_flags += -Icdk $(CURSES_CFLAGS) -# Lua 5.3 compatibility with LuaJIT. -lbitlib.o linit.o: LUA_CFLAGS += -DLUA_COMPAT_BITLIB -DLUA_COMPAT_APIINTCASTS -lutf8libjit.o: LUA_CFLAGS += -Ilua/src # Executables. @@ -226,41 +206,21 @@ textadept: $(sci_objs) $(sci_lex_objs) LexLPeg.o $(sci_gtk_objs) \ scintilla-marshal.o textadept.o $(lua_objs) $(lua_lib_objs) \ lspawn.o gtdialog.o $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS) -textadeptjit: $(sci_objs) $(sci_lex_objs) LexLPegjit.o $(sci_gtk_objs) \ - scintilla-marshal.o textadeptjit.o $(luajit_lib_objs) \ - $(libluajit) lspawnjit.o gtdialog.o - $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS) textadept-curses: $(sci_objs) $(sci_lex_objs) LexLPeg-curses.o \ $(sci_curses_objs) textadept-curses.o $(lua_objs) \ $(lua_lib_objs) lspawn-curses.o gtdialog-curses.o termkey.o \ $(termkey_unix_objs) $(cdk_objs) $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS) -textadeptjit-curses: $(sci_objs) $(sci_lex_objs) LexLPegjit-curses.o \ - $(sci_curses_objs) textadeptjit-curses.o \ - $(luajit_lib_objs) $(libluajit) lspawnjit-curses.o \ - gtdialog-curses.o termkey.o $(termkey_unix_objs) \ - $(cdk_objs) - $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS) textadept.exe: $(sci_objs) $(sci_lex_objs) LexLPeg.o $(sci_gtk_objs) \ scintilla-marshal.o textadept.o textadept_rc.o $(lua_objs) \ $(lua_lib_objs) lspawn.o gtdialog.o $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS) -textadeptjit.exe: $(sci_objs) $(sci_lex_objs) LexLPegjit.o $(sci_gtk_objs) \ - scintilla-marshal.o textadeptjit.o textadept_rc.o \ - $(luajit_lib_objs) $(libluajit) lspawnjit.o gtdialog.o - $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS) textadept-curses.exe: $(sci_objs) $(sci_lex_objs) LexLPeg-curses.o \ $(sci_curses_objs) textadept-curses.o textadept_rc.o \ $(lua_objs) $(lua_lib_objs) lspawn-curses.o \ gtdialog-curses.o termkey.o $(termkey_win32_objs) \ $(cdk_objs) $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS) -textadeptjit-curses.exe: $(sci_objs) $(sci_lex_objs) LexLPegjit-curses.o \ - $(sci_curses_objs) textadeptjit-curses.o \ - textadept_rc.o $(luajit_lib_objs) $(libluajit) \ - lspawnjit-curses.o gtdialog-curses.o termkey.o \ - $(termkey_win32_objs) $(cdk_objs) - $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS) # Install/uninstall. @@ -289,9 +249,7 @@ uninstall: # Clean. -clean: - $(MAKE) CC=$(CC) -C luajit clean - rm -f *.o ../textadept* +clean: ; rm -f *.o ../textadept* # Documentation. @@ -338,7 +296,7 @@ release: $(basedir).i386 tar czf /tmp/$<.tgz $< && rm -rf $< && gpg -ab /tmp/$<.tgz $(basedir).x86_64: ; hg archive $@ -X ".hg*" release64: $(basedir).x86_64 - make clean libluajit64 + make clean PKG_CONFIG_PATH=/opt/gtk64/lib/pkgconfig make -j4 CFLAGS="$(CFLAGS) -m64" \ CXXFLAGS="$(CXXFLAGS) -m64 -static-libstdc++" || return 0 make -j4 CFLAGS="$(CFLAGS) -m64" \ @@ -355,12 +313,12 @@ win32-release: $(basedir).win32 rm -r $