This repository has been archived by the owner on Sep 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (55 loc) · 2.09 KB
/
Makefile
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
#
# Makefile
#
# Copyright 2020-2021 Alvarito050506 <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
#
all:
mkdir -p build
gcc -c -fPIC ./src/mcpi.c -I./src -o ./build/mcpi.o
gcc -shared -fPIC ./build/mcpi.o -o ./build/libmcpi.so
install:
cp ./build/libmcpi.so /usr/lib
cp ./src/mcpi.h /usr/include
chmod 0755 /usr/lib/libmcpi.so
ldconfig
test-global:
gcc ./test.c -lmcpi -o ./build/test.elf
test-local:
gcc ./src/test.c -I./src/ -L./build/ -lmcpi -Wl,-rpath=./build/ -lmcpi -o ./build/test.elf
pack:
mkdir -p ./deb/
mkdir -p ./deb/usr/lib/
mkdir -p ./deb/usr/include/
mkdir -p ./deb/DEBIAN/
cp ./build/libmcpi.so ./deb/usr/lib/
cp ./src/mcpi.h ./deb/usr/include/
chmod 0755 ./deb/usr/lib/libmcpi.so
@echo "Package: libmcpi" > ./deb/DEBIAN/control
@echo "Version: 0.2.0" >> ./deb/DEBIAN/control
@echo "Priority: optional" >> ./deb/DEBIAN/control
@echo "Architecture: armhf" >> ./deb/DEBIAN/control
@echo "Maintainer: Alvarito050506 <[email protected]>" >> ./deb/DEBIAN/control
@echo "Homepage: https://mcpirevival.tk" >> ./deb/DEBIAN/control
@echo "Vcs-Browser: https://github.com/MCPI-Devs/libmcpi" >> ./deb/DEBIAN/control
@echo "Vcs-Git: https://github.com/MCPI-Devs/libmcpi.git" >> ./deb/DEBIAN/control
@echo "Description: C library for interacting with and extending the Minecraft Pi Protocol.\n" >> ./deb/DEBIAN/control
dpkg-deb -b ./deb/ ./libmcpi_0.2.0-1.deb
clean:
rm -rf ./build/
rm -rf ./deb/
rm -f ./libmcpi_*-*.deb