2022-01-18 23:04:48 +01:00
|
|
|
NAME = uwufetch
|
|
|
|
FILES = uwufetch.c
|
|
|
|
CFLAGS = -O3
|
|
|
|
CFLAGS_DEBUG = -Wall -Wextra -g -pthread
|
|
|
|
CC = cc
|
|
|
|
DESTDIR = /usr
|
2022-01-29 12:00:48 +01:00
|
|
|
PLATFORM = $(shell uname)
|
2021-11-01 16:48:54 +01:00
|
|
|
|
2022-01-29 12:00:48 +01:00
|
|
|
ifeq ($(PLATFORM), Linux)
|
2022-01-29 11:33:19 +01:00
|
|
|
PREFIX = bin
|
|
|
|
LIBDIR = lib
|
2022-01-18 23:04:48 +01:00
|
|
|
MANDIR = share/man/man1
|
2022-01-29 12:00:48 +01:00
|
|
|
ifeq ($(shell uname -o), Android)
|
2022-01-29 12:19:39 +01:00
|
|
|
DESTDIR = /data/data/com.termux/files/usr
|
2022-01-29 12:00:48 +01:00
|
|
|
endif
|
2022-01-29 11:52:50 +01:00
|
|
|
else ifeq ($(PLATFORM), Darwin)
|
2022-01-18 23:04:48 +01:00
|
|
|
PREFIX = local/bin
|
|
|
|
LIBDIR = local/lib
|
|
|
|
MANDIR = local/share/man/man1
|
2022-01-29 11:52:50 +01:00
|
|
|
else ifeq ($(PLATFORM), FreeBSD)
|
2022-01-29 12:00:48 +01:00
|
|
|
CFLAGS += -D__FREEBSD__
|
2021-07-24 12:56:18 +02:00
|
|
|
CFLAGS_DEBUG += -D__FREEBSD__
|
2022-01-29 11:33:19 +01:00
|
|
|
PREFIX = bin
|
|
|
|
LIBDIR = lib
|
2022-01-18 23:04:48 +01:00
|
|
|
MANDIR = share/man/man1
|
2022-01-29 11:52:50 +01:00
|
|
|
else ifeq ($(PLATFORM), windows32)
|
2022-01-29 12:00:48 +01:00
|
|
|
CC = gcc
|
2021-11-01 16:48:54 +01:00
|
|
|
PREFIX = "C:\Program Files"
|
|
|
|
LIBDIR =
|
|
|
|
MANDIR =
|
2021-06-07 00:34:07 +02:00
|
|
|
endif
|
2021-07-21 22:36:10 +02:00
|
|
|
|
2021-04-06 14:43:34 +02:00
|
|
|
build: $(FILES)
|
2021-04-23 18:02:05 +02:00
|
|
|
$(CC) $(CFLAGS) -o $(NAME) $(FILES)
|
2021-01-18 21:19:20 +01:00
|
|
|
|
2021-03-11 22:39:16 +01:00
|
|
|
debug:
|
2021-04-23 18:02:05 +02:00
|
|
|
$(CC) $(CFLAGS_DEBUG) -o $(NAME) $(FILES)
|
2021-12-18 21:39:27 +01:00
|
|
|
./$(NAME)
|
2021-03-07 22:04:05 +01:00
|
|
|
|
2022-01-29 11:34:56 +01:00
|
|
|
install: build
|
2022-01-18 23:04:48 +01:00
|
|
|
mkdir -p $(DESTDIR)/$(PREFIX) $(DESTDIR)/$(LIBDIR)/uwufetch $(DESTDIR)/$(MANDIR)
|
|
|
|
cp $(NAME) $(DESTDIR)/$(PREFIX)/$(NAME)
|
|
|
|
cp -r res/* $(DESTDIR)/$(LIBDIR)/uwufetch
|
|
|
|
cp ./$(NAME).1.gz $(DESTDIR)/$(MANDIR)/
|
2021-03-05 12:03:09 +01:00
|
|
|
|
|
|
|
uninstall:
|
2022-01-18 23:04:48 +01:00
|
|
|
rm -f $(DESTDIR)/$(PREFIX)/$(NAME)
|
|
|
|
rm -rf $(DESTDIR)/$(LIBDIR)/uwufetch
|
|
|
|
rm -f $(DESTDIR)/$(MANDIR)/$(NAME).1.gz
|
2021-03-07 00:19:03 +01:00
|
|
|
|
2022-01-29 10:39:13 +01:00
|
|
|
clean:
|
|
|
|
rm $(NAME)
|
|
|
|
|
2021-04-23 18:02:05 +02:00
|
|
|
man:
|
2021-08-27 20:30:54 +02:00
|
|
|
gzip --keep $(NAME).1
|
2021-04-23 18:02:05 +02:00
|
|
|
|
2021-04-18 23:51:32 +02:00
|
|
|
man_debug:
|
2021-04-12 13:16:45 +02:00
|
|
|
@clear
|
2021-08-27 20:30:54 +02:00
|
|
|
man -P cat ./uwufetch.1
|