comparison third_party/luajit/Makefile @ 186:8cf4ec5e2191 hg-web

Fixed merge conflict.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 22:38:59 -0800
parents 94705b5986b3
children
comparison
equal deleted inserted replaced
176:fed99fc04e12 186:8cf4ec5e2191
1 ##############################################################################
2 # LuaJIT top level Makefile for installation. Requires GNU Make.
3 #
4 # Please read doc/install.html before changing any variables!
5 #
6 # Suitable for POSIX platforms (Linux, *BSD, OSX etc.).
7 # Note: src/Makefile has many more configurable options.
8 #
9 # ##### This Makefile is NOT useful for Windows! #####
10 # For MSVC, please follow the instructions given in src/msvcbuild.bat.
11 # For MinGW and Cygwin, cd to src and run make with the Makefile there.
12 #
13 # Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h
14 ##############################################################################
15
16 MAJVER= 2
17 MINVER= 1
18 ABIVER= 5.1
19
20 # LuaJIT uses rolling releases. The release version is based on the time of
21 # the latest git commit. The 'git' command must be available during the build.
22 RELVER= $(shell cat src/luajit_relver.txt 2>/dev/null || : )
23 # Note: setting it with := doesn't work, since it will change during the build.
24
25 MMVERSION= $(MAJVER).$(MINVER)
26 VERSION= $(MMVERSION).$(RELVER)
27
28 ##############################################################################
29 #
30 # Change the installation path as needed. This automatically adjusts
31 # the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path!
32 #
33 export PREFIX= /usr/local
34 export MULTILIB= lib
35 ##############################################################################
36
37 DPREFIX= $(DESTDIR)$(PREFIX)
38 INSTALL_BIN= $(DPREFIX)/bin
39 INSTALL_LIB= $(DPREFIX)/$(MULTILIB)
40 INSTALL_SHARE= $(DPREFIX)/share
41 INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MMVERSION)
42 INSTALL_INC= $(INSTALL_DEFINC)
43
44 INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(MMVERSION)
45 INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit
46 INSTALL_LMODD= $(INSTALL_SHARE)/lua
47 INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER)
48 INSTALL_CMODD= $(INSTALL_LIB)/lua
49 INSTALL_CMOD= $(INSTALL_CMODD)/$(ABIVER)
50 INSTALL_MAN= $(INSTALL_SHARE)/man/man1
51 INSTALL_PKGCONFIG= $(INSTALL_LIB)/pkgconfig
52
53 INSTALL_TNAME= luajit-$(VERSION)
54 INSTALL_TSYMNAME= luajit
55 INSTALL_ANAME= libluajit-$(ABIVER).a
56 INSTALL_SOSHORT1= libluajit-$(ABIVER).so
57 INSTALL_SOSHORT2= libluajit-$(ABIVER).so.$(MAJVER)
58 INSTALL_SONAME= libluajit-$(ABIVER).so.$(VERSION)
59 INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib
60 INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib
61 INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(VERSION).dylib
62 INSTALL_PCNAME= luajit.pc
63
64 INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME)
65 INSTALL_DYN= $(INSTALL_LIB)/$(INSTALL_SONAME)
66 INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_SOSHORT1)
67 INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_SOSHORT2)
68 INSTALL_T= $(INSTALL_BIN)/$(INSTALL_TNAME)
69 INSTALL_TSYM= $(INSTALL_BIN)/$(INSTALL_TSYMNAME)
70 INSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME)
71
72 INSTALL_DIRS= $(INSTALL_BIN) $(INSTALL_LIB) $(INSTALL_INC) $(INSTALL_MAN) \
73 $(INSTALL_PKGCONFIG) $(INSTALL_JITLIB) $(INSTALL_LMOD) $(INSTALL_CMOD)
74 UNINSTALL_DIRS= $(INSTALL_JITLIB) $(INSTALL_LJLIBD) $(INSTALL_INC) \
75 $(INSTALL_LMOD) $(INSTALL_LMODD) $(INSTALL_CMOD) $(INSTALL_CMODD)
76
77 RM= rm -f
78 MKDIR= mkdir -p
79 RMDIR= rmdir 2>/dev/null
80 SYMLINK= ln -sf
81 INSTALL_X= install -m 0755
82 INSTALL_F= install -m 0644
83 UNINSTALL= $(RM)
84 LDCONFIG= ldconfig -n 2>/dev/null
85 SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
86 -e "s|^multilib=.*|multilib=$(MULTILIB)|" \
87 -e "s|^relver=.*|relver=$(RELVER)|"
88 ifneq ($(INSTALL_DEFINC),$(INSTALL_INC))
89 SED_PC+= -e "s|^includedir=.*|includedir=$(INSTALL_INC)|"
90 endif
91
92 FILE_T= luajit
93 FILE_A= libluajit.a
94 FILE_SO= libluajit.so
95 FILE_MAN= luajit.1
96 FILE_PC= luajit.pc
97 FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h
98 FILES_JITLIB= bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua \
99 dis_x86.lua dis_x64.lua dis_arm.lua dis_arm64.lua \
100 dis_arm64be.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua \
101 dis_mips64.lua dis_mips64el.lua \
102 dis_mips64r6.lua dis_mips64r6el.lua \
103 vmdef.lua
104
105 ifeq (,$(findstring Windows,$(OS)))
106 HOST_SYS:= $(shell uname -s)
107 else
108 HOST_SYS= Windows
109 endif
110 TARGET_SYS?= $(HOST_SYS)
111
112 ifeq (Darwin,$(TARGET_SYS))
113 INSTALL_SONAME= $(INSTALL_DYLIBNAME)
114 INSTALL_SOSHORT1= $(INSTALL_DYLIBSHORT1)
115 INSTALL_SOSHORT2= $(INSTALL_DYLIBSHORT2)
116 LDCONFIG= :
117 endif
118
119 ##############################################################################
120
121 INSTALL_DEP= src/luajit
122
123 default all $(INSTALL_DEP):
124 @echo "==== Building LuaJIT $(MMVERSION) ===="
125 $(MAKE) -C src
126 @echo "==== Successfully built LuaJIT $(MMVERSION) ===="
127
128 install: $(INSTALL_DEP)
129 @echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ===="
130 $(MKDIR) $(INSTALL_DIRS)
131 cd src && $(INSTALL_X) $(FILE_T) $(INSTALL_T)
132 cd src && test -f $(FILE_A) && $(INSTALL_F) $(FILE_A) $(INSTALL_STATIC) || :
133 $(RM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2)
134 cd src && test -f $(FILE_SO) && \
135 $(INSTALL_X) $(FILE_SO) $(INSTALL_DYN) && \
136 ( $(LDCONFIG) $(INSTALL_LIB) || : ) && \
137 $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT1) && \
138 $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT2) || :
139 cd etc && $(INSTALL_F) $(FILE_MAN) $(INSTALL_MAN)
140 cd etc && $(SED_PC) $(FILE_PC) > $(FILE_PC).tmp && \
141 $(INSTALL_F) $(FILE_PC).tmp $(INSTALL_PC) && \
142 $(RM) $(FILE_PC).tmp
143 cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
144 cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
145 @echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
146 @echo ""
147 @echo "Note: the development releases deliberately do NOT install a symlink for luajit"
148 @echo "You can do this now by running this command (with sudo):"
149 @echo ""
150 @echo " $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)"
151 @echo ""
152
153
154 uninstall:
155 @echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ===="
156 $(UNINSTALL) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
157 for file in $(FILES_JITLIB); do \
158 $(UNINSTALL) $(INSTALL_JITLIB)/$$file; \
159 done
160 for file in $(FILES_INC); do \
161 $(UNINSTALL) $(INSTALL_INC)/$$file; \
162 done
163 $(LDCONFIG) $(INSTALL_LIB)
164 $(RMDIR) $(UNINSTALL_DIRS) || :
165 @echo "==== Successfully uninstalled LuaJIT $(VERSION) from $(PREFIX) ===="
166
167 ##############################################################################
168
169 amalg:
170 @echo "==== Building LuaJIT $(MMVERSION) (amalgamation) ===="
171 $(MAKE) -C src amalg
172 @echo "==== Successfully built LuaJIT $(MMVERSION) (amalgamation) ===="
173
174 clean:
175 $(MAKE) -C src clean
176
177 .PHONY: all install amalg clean
178
179 ##############################################################################