-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (27 loc) · 856 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
CFLAGS=-Oz -s -mtune=native -march=native
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
all: fumofetch
install: $(BINS)
@echo "Installing..."
@install -D -t $(DESTDIR)$(BINDIR) fumofetch
clean:
rm -f fumofetch logo.h
fumofetch: logo.h main.c functions.c
@echo "Compiling the fumo..."
@$(CC) -o fumofetch main.c functions.c $(CFLAGS)
logo.h: logo.txt
@echo "Generating logo..."
@echo "#ifndef LOGO_H" > logo.h
@echo "#define LOGO_H" >> logo.h
@echo "#define LOGO_HEIGHT" `wc -l logo.txt | cut -d ' ' -f 1` >> logo.h
@echo >> logo.h
@echo "static const char* logo_array[] = {" >> logo.h
@while IFS= read -r line; do \
escaped_line=$$(echo "$$line" | sed 's/"/\\"/g' | sed 's/\\/\\\\/g'); \
echo " \"$$escaped_line\"," >> logo.h; \
done < logo.txt
@echo " NULL" >> logo.h
@echo "};" >> logo.h
@echo >> logo.h
@echo "#endif" >> logo.h