Lines 1-65
Link Here
|
1 |
--- Makefile.orig 2020-03-29 23:58:44 UTC |
1 |
--- Makefile.orig 2020-05-07 03:06:00 UTC |
2 |
+++ Makefile |
2 |
+++ Makefile |
3 |
@@ -30,8 +30,7 @@ else ifeq ($(detected_OS),Windows) # Windows |
3 |
@@ -3,7 +3,7 @@ objects=nsm.o ConsoleColor.o DateTimeInfo.o Directory. |
4 |
else ifeq ($(detected_OS),FreeBSD) #FreeBSD |
4 |
cppfiles=nsm.cpp ConsoleColor.cpp DateTimeInfo.cpp Directory.cpp Expr.cpp ExprtkFns.cpp Filename.cpp FileSystem.cpp Getline.cpp GitInfo.cpp hashtk/HashTk.cpp Lolcat.cpp LuaFns.cpp Lua.cpp NumFns.cpp Pagination.cpp Parser.cpp Path.cpp ProjectInfo.cpp Quoted.cpp StrFns.cpp SystemInfo.cpp Title.cpp TrackedInfo.cpp Variables.cpp WatchList.cpp |
5 |
CXX=clang |
|
|
6 |
CXXFLAGS+= -s -Qunused-arguments -lstdc++ |
7 |
- LINK+= -ldl -lm -LLuaJIT/src -lluajit #use Nift built LuaJIT |
8 |
- #LINK+= -ldl -lm -L/usr/local/lib -lluajit-5.1 #use FreeBSD LuaJIT |
9 |
+ LINK+= -ldl -lm -L%%LOCALBASE%%/lib -lluajit-5.1 #use FreeBSD LuaJIT |
10 |
else # *nix |
11 |
#use these flags for a smaller binary |
12 |
#CXXFLAGS+= -s |
13 |
@@ -51,7 +50,7 @@ endif |
14 |
|
5 |
|
15 |
### |
6 |
DESTDIR?= |
|
|
7 |
-PREFIX?=/usr/local |
8 |
+PREFIX?=%%LOCALBASE%% |
9 |
BINDIR=${DESTDIR}${PREFIX}/bin |
10 |
LIBDIR=${DESTDIR}${PREFIX}/lib |
16 |
|
11 |
|
17 |
-all: make-luajit nsm |
12 |
@@ -79,42 +79,58 @@ ifeq ($(BUNDLED),0) |
18 |
+all: nsm |
13 |
else ifeq ($(LUA_VERSION),x) |
19 |
|
14 |
ifeq ($(detected_OS),FreeBSD) # FreeBSD |
20 |
### |
15 |
CXXFLAGS+= -D__LUA_VERSION_x__ |
21 |
|
16 |
- LINK+= -L/usr/local/lib -llua -lm -ldl |
22 |
@@ -62,9 +61,6 @@ ifeq ($(detected_OS),Darwin) # Mac OSX |
17 |
+ LINK+= -L%%LOCALBASE%%/lib -llua -lm -ldl |
23 |
else ifeq ($(detected_OS),Windows) # Windows |
18 |
else # *nix |
24 |
cd LuaJIT && make |
19 |
CXXFLAGS+= -D__LUA_VERSION_x__ |
25 |
copy LuaJIT\src\lua51.dll . |
20 |
- LINK+= -L/usr/local/lib -llua -ldl |
26 |
-else ifeq ($(detected_OS),FreeBSD) #FreeBSD |
21 |
+ LINK+= -L%%LOCALBASE%%/lib -llua -ldl |
27 |
- cd LuaJIT && gmake |
22 |
endif |
28 |
- cp LuaJIT/src/libluajit.so ./ |
23 |
else ifeq ($(LUA_VERSION),5.4) |
29 |
else # *nix |
24 |
ifeq ($(detected_OS),FreeBSD) # FreeBSD |
30 |
cd LuaJIT && make |
25 |
CXXFLAGS+= -D__LUA_VERSION_5_4__ |
31 |
endif |
26 |
- LINK+= -L/usr/local/lib -llua-5.4 -lm -ldl |
32 |
@@ -159,7 +155,6 @@ ifeq ($(detected_OS),Windows) # Windows |
27 |
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.4 -lm -ldl |
33 |
else ifeq ($(detected_OS),FreeBSD) #FreeBSD |
28 |
else # *nix |
34 |
mkdir -p ${BINDIR} |
29 |
CXXFLAGS+= -D__LUA_VERSION_5_4__ |
35 |
chmod 755 nsm |
30 |
- LINK+= -L/usr/local/lib -llua-5.4 -ldl |
36 |
- mv libluajit.so ${LIBDIR}/libluajit-5.1.so.2 |
31 |
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.4 -ldl |
37 |
mv nift ${BINDIR} |
32 |
endif |
38 |
mv nsm ${BINDIR} |
33 |
else ifeq ($(LUA_VERSION),5.3) |
39 |
else # *nix |
34 |
ifeq ($(detected_OS),FreeBSD) # FreeBSD |
40 |
@@ -175,7 +170,6 @@ ifeq ($(detected_OS),Windows) # Windows |
35 |
CXXFLAGS+= -D__LUA_VERSION_5_3__ |
41 |
@echo "and 'nift.exe' from install location, typically " |
36 |
- LINK+= -L/usr/local/lib -llua-5.3 -lm -ldl |
42 |
@echo "'C:\Windows\System32'" |
37 |
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.3 -lm -ldl |
43 |
else ifeq ($(detected_OS),FreeBSD) #FreeBSD |
38 |
else # *nix |
44 |
- rm ${LIBDIR}/libluajit-5.1.so.2 |
39 |
CXXFLAGS+= -D__LUA_VERSION_5_3__ |
45 |
rm ${BINDIR}/nift |
40 |
- LINK+= -L/usr/local/lib -llua-5.3 -ldl |
46 |
rm ${BINDIR}/nsm |
41 |
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.3 -ldl |
47 |
else # *nix |
42 |
endif |
48 |
@@ -201,7 +195,6 @@ else ifeq ($(detected_OS),Windows) # Windows |
43 |
+ else ifeq ($(LUA_VERSION),5.2) |
49 |
#cd LuaJIT && make clean #this doesn't work for some reason |
44 |
+ ifeq ($(detected_OS),FreeBSD) # FreeBSD |
50 |
else ifeq ($(detected_OS),FreeBSD) #FreeBSD |
45 |
+ CXXFLAGS+= -D__LUA_VERSION_5_2__ |
51 |
rm -f $(objects) |
46 |
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.2 -lm -ldl |
52 |
- cd LuaJIT && gmake clean |
47 |
+ else # *nix |
53 |
else # *nix |
48 |
+ CXXFLAGS+= -D__LUA_VERSION_5_2__ |
54 |
rm -f $(objects) |
49 |
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.2 -ldl |
55 |
cd LuaJIT && make clean |
50 |
+ endif |
56 |
@@ -215,8 +208,7 @@ else ifeq ($(detected_OS),Windows) # Windows |
51 |
+ else ifeq ($(LUA_VERSION),5.1) |
57 |
del -f $(objects) nsm.exe nift.exe lua51.dll |
52 |
+ ifeq ($(detected_OS),FreeBSD) # FreeBSD |
58 |
#cd LuaJIT && make clean #see same line for clean |
53 |
+ CXXFLAGS+= -D__LUA_VERSION_5_1__ |
59 |
else ifeq ($(detected_OS),FreeBSD) #FreeBSD |
54 |
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.1 -lm -ldl |
60 |
- rm -f $(objects) nsm nift libluajit.so |
55 |
+ else # *nix |
61 |
- cd LuaJIT && gmake clean |
56 |
+ CXXFLAGS+= -D__LUA_VERSION_5_1__ |
62 |
+ rm -f $(objects) nsm nift |
57 |
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.1 -ldl |
63 |
else # *nix |
58 |
+ endif |
64 |
rm -f $(objects) nsm nift |
59 |
else ifeq ($(LUAJIT_VERSION),2.0) |
65 |
cd LuaJIT && make clean |
60 |
ifeq ($(detected_OS),FreeBSD) # FreeBSD |
|
|
61 |
CXXFLAGS+= -D__LUAJIT_VERSION_2_0__ |
62 |
- LINK+= -ldl -lm -L/usr/local/lib -lluajit-5.1 |
63 |
+ LINK+= -ldl -lm -L%%LOCALBASE%%/lib -lluajit-5.1 |
64 |
else # *nix |
65 |
CXXFLAGS+= -D__LUAJIT_VERSION_2_0__ |
66 |
- LINK+= -ldl -L/usr/local/lib -lluajit-5.1 |
67 |
+ LINK+= -ldl -L%%LOCALBASE%%/lib -lluajit-5.1 |
68 |
endif |
69 |
else |
70 |
ifeq ($(detected_OS),FreeBSD) # FreeBSD |
71 |
CXXFLAGS+= -D__LUAJIT_VERSION_2_1__ |
72 |
- LINK+= -ldl -lm -L/usr/local/lib -lluajit-5.1 |
73 |
+ LINK+= -ldl -lm -L%%LOCALBASE%%/lib -lluajit-5.1 |
74 |
else # *nix |
75 |
CXXFLAGS+= -D__LUAJIT_VERSION_2_1__ |
76 |
- LINK+= -ldl -L/usr/local/lib -lluajit-5.1 |
77 |
+ LINK+= -ldl -L%%LOCALBASE%%/lib -lluajit-5.1 |
78 |
endif |
79 |
endif |
80 |
else |