-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
34 lines (31 loc) · 1016 Bytes
/
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
# Project & compiler information
NAME=kermit
CFLAGS=-s -O3 -Wall -Wno-deprecated-declarations $(shell pkg-config --cflags vte-2.91)
LIBS=$(shell pkg-config --libs vte-2.91)
CC=gcc
all: clean build
# Build the project
build:
mkdir build || true
$(CC) $(CFLAGS) src/$(NAME).c -o build/$(NAME) $(LIBS)
cp .config/$(NAME).desktop build/
cp README.md build/
gzip -cn man/$(NAME).1 > build/$(NAME).1.gz
# Make the installation
install:
# Create directories if they don't exist
mkdir $(TARGET)/usr/bin || true
mkdir $(TARGET)/usr/share/applications || true
mkdir $(TARGET)/usr/share/doc || true
mkdir $(TARGET)/usr/share/man/man1 || true
# Install binary
install -Dm 755 build/$(NAME) -t $(TARGET)/usr/bin
# Install desktop entry
install -Dm 644 build/$(NAME).desktop -t $(TARGET)/usr/share/applications
# Install README.md
install -Dm 644 README.md -t $(TARGET)/usr/share/doc/$(TARGET)
# Install man page
install -Dm 644 build/$(NAME).1.gz -t $(TARGET)/usr/share/man/man1
# Clean
clean:
rm -rf build