Merge pull request #63 from em1lyy/main

improve Makefile
This commit is contained in:
TheDarkBug 2021-04-06 16:02:37 +02:00 committed by GitHub
commit bee9a1b525
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,31 +1,32 @@
NAME = uwufetch NAME = uwufetch
FILES = uwufetch.c FILES = uwufetch.c
FLAGS = -O3 CFLAGS = -O3
FLAGS_DEBUG = -Wall -Wextra CFLAGS_DEBUG = -Wall -Wextra
INSTALL_DIR = /usr/bin/ PREFIX = /usr/bin
CC = cc
build: uwufetch.c build: $(FILES)
gcc $(FLAGS) -o $(NAME) $(FILES) $(CC) $(CFLAGS) -o $(NAME) $(FILES)
debug: debug:
@clear @clear
gcc $(FLAGS_DEBUG) -o $(NAME) $(FILES) $(CC) $(CFLAGS_DEBUG) -o $(NAME) $(FILES)
./uwufetch ./uwufetch
install: install:
cp $(NAME) $(INSTALL_DIR)$(NAME) cp $(NAME) $(DESTDIR)$(INSTALL_DIR)/$(NAME)
ls /usr/lib/uwufetch/ 2> /dev/null || mkdir /usr/lib/uwufetch/ ls $(DESTDIR)/usr/lib/uwufetch/ 2> /dev/null || mkdir $(DESTDIR)/usr/lib/uwufetch/
cp res/* /usr/lib/uwufetch/ cp res/* $(DESTDIR)/usr/lib/uwufetch/
uninstall: uninstall:
rm $(INSTALL_DIR)$(NAME) rm -f $(DESTDIR)$(INSTALL_DIR)/$(NAME)
rm -rf /usr/lib/uwufetch/ rm -rf $(DESTDIR)/usr/lib/uwufetch/
termux: build termux: build
cp $(NAME) /data/data/com.termux/files$(INSTALL_DIR)$(NAME) cp $(NAME) $(DESTDIR)/data/data/com.termux/files$(INSTALL_DIR)/$(NAME)
ls /data/data/com.termux/files/usr/lib/uwufetch/ > /dev/null || mkdir /data/data/com.termux/files/usr/lib/uwufetch/ ls $(DESTDIR)/data/data/com.termux/files/usr/lib/uwufetch/ > /dev/null || mkdir $(DESTDIR)/data/data/com.termux/files/usr/lib/uwufetch/
cp res/* /data/data/com.termux/files/usr/lib/uwufetch/ cp res/* /data/data/com.termux/files/usr/lib/uwufetch/
termux_uninstall: termux_uninstall:
rm -rf /data/data/com.termux/files$(INSTALL_DIR)$(NAME) rm -rf $(DESTDIR)/data/data/com.termux/files$(INSTALL_DIR)/$(NAME)
rm -rf /data/data/com.termux/files/usr/lib/uwufetch/ rm -rf $(DESTDIR)/data/data/com.termux/files/usr/lib/uwufetch/