This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.common
150 lines (114 loc) · 4.96 KB
/
makefile.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
MKDIR = mkdir -p
DEST_HOME=/usr/local
DEST_BIN=$(DEST_HOME)/bin
DEST_SHARE=$(DEST_HOME)/lib/p7zip
DEST_SHARE_DOC=$(DEST_HOME)/share/doc/p7zip
DEST_MAN=$(DEST_HOME)/man
.PHONY: default all all2 7za 7zG 7zFM sfx 7z 7zr Client7z common common7z LangAndHelp tar_bin depend test test_7z test_7zr test_7zG test_Client7z LzmaCon test_LzmaCon all_test app cppcheck lzham test_lib other
.PHONY: clean clean_full clean_C
include makefile.machine
default:7za
all:7za sfx
all2: all 7z
all3: all2 7zr
all4: all3 Client7z LzmaCon lzham test_lib
all4bis: all3 Client7z LzmaCon test_lib # lzham not supported on x32 CPU.
all5: all4 7zG 7zFM
all6: all5 other
all_all : all6
all_test : test test_7z test_7zr test_LzmaCon test_Client7z
all_test2 : all_test test_7zG
common:
$(MKDIR) bin
app: common 7zFM 7zG 7z sfx
rm -fr p7zip.app
$(MKDIR) p7zip.app
cp -rp GUI/Contents p7zip.app/
$(MKDIR) p7zip.app/Contents
$(MKDIR) p7zip.app/Contents/MacOS
cp bin/7zFM_do_not_use p7zip.app/Contents/MacOS/
cp bin/7zG p7zip.app/Contents/MacOS/
cp bin/7z.so p7zip.app/Contents/MacOS/
cp bin/7zCon.sfx p7zip.app/Contents/MacOS/
cp -rp bin/Codecs p7zip.app/Contents/MacOS/
cp -rp GUI/Lang p7zip.app/Contents/MacOS/
cp -rp DOC/MANUAL p7zip.app/Contents/MacOS/help
LangAndHelp:
cd bin ; rm -f Lang ; ln -s ../GUI/Lang .
cd bin ; rm -f help ; ln -s ../DOC/MANUAL help
clean: clean_C
rm -fr bin
rm -fr p7zip.app
rm -f Lang
rm -fr CPP/7zip/P7ZIP.*
rm -fr CPP/7zip/CMAKE/P7ZIP.*
rm -fr CPP/7zip/PREMAKE/P7ZIP.*
rm -f CPP/7zip/QMAKE/*/*.o
rm -f CPP/7zip/QMAKE/*/Makefile
rm -f CPP/7zip/QMAKE/*/*.pro.user
rm -f CPP/7zip/QMAKE/*/*.x
-find . -name "build*" -exec rm -fr {} \;
-find . -name "*-build-*" -exec rm -fr {} \;
-find . -name "*.user" -exec rm -f {} \;
-find . -name "._*" -exec rm -f {} \;
rm -fr CPP/7zip/ANDROID/libs
rm -fr CPP/7zip/ANDROID/obj
rm -f make.log 1 2 cppcheck.out scan-build.out
rm -f check/7z.so
rm -fr p7zip.app/Contents/MacOS
cd check ; ./clean_all.sh
clean_full:clean
find . -name "makefile.depend" -exec rm -f {} \; -exec touch {} \; # empty makefile.depend
find . -name "*~" -exec rm -f {} \;
find . -name "*.orig" -exec rm -fr {} \; # kdiff3 merge
find . -name ".*.swp" -exec rm -f {} \;
find . -name "*.i" -exec rm -f {} \;
find . -name "*.s" -exec rm -f {} \;
find . -name ".DS_Store" -exec rm -f {} \; # MacOSX
find . -name "._*" -exec rm -f {} \; # MacOSX
find . -name "*.pyc" -exec rm -f {} \;
find . -name "*.[ch]" -exec chmod -x {} \;
find . -name "*.cpp" -exec chmod -x {} \;
find . -name "*.asm" -exec chmod -x {} \;
find . -name "makefile*" -exec chmod -x {} \;
chmod -x ChangeLog README TODO man1/* DOC/*.txt
chmod +x contrib/VirtualFileSystemForMidnightCommander/u7z
chmod +x contrib/gzip-like_CLI_wrapper_for_7z/p7zip
chmod +x install.sh check/*.sh
test: 7za sfx
cd check ; TOOLS="${TOOLS}" ./check.sh "`pwd`/../bin/7za"
test_7z: 7z sfx
cd check ; TOOLS="${TOOLS}" ./check.sh "`pwd`/../bin/7z"
test_7zr: 7zr sfx
cd check ; TOOLS="${TOOLS}" ./check_7zr.sh "`pwd`/../bin/7zr"
test_7zG: 7zG sfx
cd check ; TOOLS="${TOOLS}" ./check.sh "`pwd`/../bin/7zG"
test_Client7z: Client7z
cd check ; TOOLS="${TOOLS}" ./check_Client7z.sh "`pwd`/../bin/Client7z"
install:
./install.sh $(DEST_BIN) $(DEST_SHARE) $(DEST_MAN) $(DEST_SHARE_DOC) $(DEST_DIR)
# cppcheck -f : test all flags
cppcheck:
cppcheck --enable=all -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -DENV_UNIX -D_7ZIP_LARGE_PAGES -DBREAK_HANDLER -DUNICODE -D_UNICODE . 2>&1 | tee -i cppcheck.out
REP=$(shell pwd)
ARCHIVE=$(shell basename $(REP))
.PHONY: tar_all tar_all2 src_7z tar_bin tar_bin2
tar_all : clean_full
rm -f ../$(ARCHIVE)_src_all.tar.bz2
cp makefile.linux_any_cpu makefile.machine
cd .. ; (tar cf - $(ARCHIVE) | bzip2 -9 > $(ARCHIVE)_src_all.tar.bz2)
tar_all2 : clean_full
rm -f ../$(ARCHIVE)_src_all.tar.bz2
cp makefile.linux_any_cpu makefile.machine
cd .. ; (tar cf - $(ARCHIVE) | 7za a -mx=9 -tbzip2 -si $(ARCHIVE)_src_all.tar.bz2 )
src_7z : clean_full
rm -f ../$(ARCHIVE)_src.7z
cd .. ; 7za a -mx=9 -m0=ppmd:mem=128m:o=32 $(ARCHIVE)_src.7z $(ARCHIVE)
tar_bin:
rm -f ../$(ARCHIVE)_x86_linux_bin.tar.bz2
chmod +x install.sh contrib/VirtualFileSystemForMidnightCommander/u7z contrib/gzip-like_CLI_wrapper_for_7z/p7zip
cd .. ; (tar cf - $(ARCHIVE)/bin $(ARCHIVE)/contrib $(ARCHIVE)/man1 $(ARCHIVE)/install.sh $(ARCHIVE)/ChangeLog $(ARCHIVE)/DOC $(ARCHIVE)/README $(ARCHIVE)/TODO | bzip2 -9 > $(ARCHIVE)_x86_linux_bin.tar.bz2)
tar_bin2:
rm -f ../$(ARCHIVE)_x86_linux_bin.tar.bz2
chmod +x install.sh contrib/VirtualFileSystemForMidnightCommander/u7z contrib/gzip-like_CLI_wrapper_for_7z/p7zip
cd .. ; (tar cf - $(ARCHIVE)/bin $(ARCHIVE)/contrib $(ARCHIVE)/man1 $(ARCHIVE)/install.sh $(ARCHIVE)/ChangeLog $(ARCHIVE)/DOC $(ARCHIVE)/README $(ARCHIVE)/TODO | 7za a -mx=9 -tbzip2 -si $(ARCHIVE)_x86_linux_bin.tar.bz2)