Updated makefile for a more customized installation
This commit is contained in:
parent
d84fc73c54
commit
b05a9d965f
1 changed files with 22 additions and 21 deletions
33
Makefile
33
Makefile
|
@ -3,21 +3,22 @@ FILES = uwufetch.c
|
|||
CFLAGS = -O3
|
||||
CFLAGS_DEBUG = -Wall -Wextra -g -pthread
|
||||
CC = cc
|
||||
DESTDIR = /usr
|
||||
|
||||
ifeq ($(shell uname), Linux)
|
||||
PREFIX = /usr/bin
|
||||
LIBDIR = /usr/lib
|
||||
MANDIR = /usr/share/man/man1
|
||||
PREFIX = bin
|
||||
LIBDIR = lib
|
||||
MANDIR = share/man/man1
|
||||
else ifeq ($(shell uname), Darwin)
|
||||
PREFIX = /usr/local/bin
|
||||
LIBDIR = /usr/local/lib
|
||||
MANDIR = /usr/local/share/man/man1
|
||||
PREFIX = local/bin
|
||||
LIBDIR = local/lib
|
||||
MANDIR = local/share/man/man1
|
||||
else ifeq ($(shell uname), FreeBSD)
|
||||
CFLAGS += -D__FREEBSD__
|
||||
CFLAGS_DEBUG += -D__FREEBSD__
|
||||
PREFIX = /usr/bin
|
||||
LIBDIR = /usr/lib
|
||||
MANDIR = /usr/share/man/man1
|
||||
PREFIX = bin
|
||||
LIBDIR = lib
|
||||
MANDIR = share/man/man1
|
||||
else ifeq ($(shell uname), windows32)
|
||||
CC = gcc
|
||||
PREFIX = "C:\Program Files"
|
||||
|
@ -33,15 +34,15 @@ debug:
|
|||
./$(NAME)
|
||||
|
||||
install:
|
||||
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)/
|
||||
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)/
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/$(NAME)
|
||||
rm -rf $(DESTDIR)$(LIBDIR)/uwufetch
|
||||
rm -f $(DESTDIR)$(MANDIR)/$(NAME).1.gz
|
||||
rm -f $(DESTDIR)/$(PREFIX)/$(NAME)
|
||||
rm -rf $(DESTDIR)/$(LIBDIR)/uwufetch
|
||||
rm -f $(DESTDIR)/$(MANDIR)/$(NAME).1.gz
|
||||
|
||||
termux: build
|
||||
cp $(NAME) $(DESTDIR)/data/data/com.termux/files$(PREFIX)/$(NAME)
|
||||
|
|
Loading…
Reference in a new issue