neowofetch/Makefile

65 lines
1.3 KiB
Makefile
Raw Normal View History

NAME = uwufetch
FILES = uwufetch.c
CFLAGS = -O3
CFLAGS_DEBUG = -Wall -Wextra -g -pthread
CC = cc
DESTDIR = /usr
PLATFORM = $(shell uname)
2021-11-01 16:48:54 +01:00
ifeq ($(PLATFORM), Linux)
PREFIX = bin
LIBDIR = lib
2022-03-08 21:24:52 +01:00
ETC_DIR = /etc
MANDIR = share/man/man1
ifeq ($(shell uname -o), Android)
2022-01-29 12:19:39 +01:00
DESTDIR = /data/data/com.termux/files/usr
ETC_DIR = $(DESTDIR)/etc
endif
2022-01-29 11:52:50 +01:00
else ifeq ($(PLATFORM), Darwin)
PREFIX = local/bin
LIBDIR = local/lib
2022-03-08 21:24:52 +01:00
ETC_DIR = /etc
MANDIR = local/share/man/man1
2022-01-29 11:52:50 +01:00
else ifeq ($(PLATFORM), FreeBSD)
CFLAGS += -D__FREEBSD__
2021-07-24 12:56:18 +02:00
CFLAGS_DEBUG += -D__FREEBSD__
PREFIX = bin
LIBDIR = lib
2022-03-08 21:24:52 +01:00
ETC_DIR = /etc
MANDIR = share/man/man1
2022-01-29 11:52:50 +01:00
else ifeq ($(PLATFORM), windows32)
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
build: $(FILES)
$(CC) $(CFLAGS) -o $(NAME) $(FILES)
2021-01-18 21:19:20 +01:00
debug:
$(CC) $(CFLAGS_DEBUG) -o $(NAME) $(FILES)
./$(NAME)
2022-01-29 11:34:56 +01:00
install: build
2022-03-08 21:24:52 +01:00
mkdir -p $(DESTDIR)/$(PREFIX) $(DESTDIR)/$(LIBDIR)/uwufetch $(DESTDIR)/$(MANDIR) $(ETC_DIR)/uwufetch
cp $(NAME) $(DESTDIR)/$(PREFIX)/$(NAME)
cp -r res/* $(DESTDIR)/$(LIBDIR)/uwufetch
2022-03-08 21:26:42 +01:00
cp default.config $(ETC_DIR)/uwufetch/config
cp ./$(NAME).1.gz $(DESTDIR)/$(MANDIR)/
uninstall:
rm -f $(DESTDIR)/$(PREFIX)/$(NAME)
rm -rf $(DESTDIR)/$(LIBDIR)/uwufetch
rm -f $(DESTDIR)/$(MANDIR)/$(NAME).1.gz
clean:
rm $(NAME)
man:
2021-08-27 20:30:54 +02:00
gzip --keep $(NAME).1
man_debug:
2021-04-12 13:16:45 +02:00
@clear
2021-08-27 20:30:54 +02:00
man -P cat ./uwufetch.1