1
0
Fork 0
src/Makefile

311 lines
9.2 KiB
Makefile
Raw Normal View History

2022-05-27 21:58:49 +00:00
# System utilities
2022-05-15 00:52:07 +00:00
CC=cc
2022-06-26 20:34:29 +00:00
CFLAGS=-Iinclude/ -Ilib/ -g -Wall -Wextra -Wpedantic
2022-05-15 00:52:07 +00:00
RM=rm -f
all: libraries programs
2022-06-26 20:34:29 +00:00
cleanall: clean cleanprograms
2022-05-15 00:52:07 +00:00
clean:
2022-06-26 20:34:29 +00:00
$(RM) build/*
2022-05-15 00:52:07 +00:00
cleanprograms:
$(RM) bin/add
2022-06-26 20:34:29 +00:00
$(RM) bin/calculate
2022-05-15 00:52:07 +00:00
$(RM) bin/cut
$(RM) bin/echo
2022-09-16 14:58:18 +00:00
$(MAKE) -C echo clean
2022-05-15 00:52:07 +00:00
$(RM) bin/eq
$(RM) bin/false
$(RM) bin/fdivide
$(RM) bin/gt
2022-06-26 20:34:29 +00:00
$(RM) bin/id
2022-05-15 00:52:07 +00:00
$(RM) bin/lowercase
$(RM) bin/lt
$(RM) bin/mm
$(RM) bin/multiply
2022-09-17 04:31:52 +00:00
$(MAKE) -C nonzero clean
2022-07-19 20:52:28 +00:00
$(RM) bin/pscat
2022-08-23 15:40:45 +00:00
$(RM) bin/rot13
2022-09-16 14:58:18 +00:00
$(MAKE) -C rot13 clean
2022-05-15 00:52:07 +00:00
$(RM) bin/simexec
$(RM) bin/sleep
$(RM) bin/streq
2022-06-14 21:07:27 +00:00
$(RM) bin/str
2022-09-16 14:58:18 +00:00
$(MAKE) -C str clean
2022-05-15 00:52:07 +00:00
$(RM) bin/substitute
2022-06-26 20:34:29 +00:00
$(RM) bin/sysexits
2022-08-23 16:49:42 +00:00
$(RM) bin/retval
2022-06-26 20:34:29 +00:00
$(RM) bin/rldecode
$(RM) bin/rlencode
$(RM) bin/roll
2022-09-16 14:58:18 +00:00
$(MAKE) -C roll clean
2022-05-15 00:52:07 +00:00
$(RM) bin/tail
2022-06-26 20:50:41 +00:00
$(RM) bin/true
2022-05-15 00:52:07 +00:00
2022-06-14 21:07:27 +00:00
libraries: libio libshell stdbool sysexits
libio: lib/libio.c
$(CC) $(CFLAGS) -c -o build/libio.o lib/libio.c
2022-05-15 00:52:07 +00:00
libshell: lib/libshell.c lib/libshell.h
$(CC) $(CFLAGS) -o lib/libshell.o -c lib/libshell.c
libstr: lib/libstr.c lib/libstr.h
$(CC) $(CFLAGS) -o lib/libstr.o -c lib/libstr.c
stdbool: include/stdbool.h
2022-05-27 21:58:49 +00:00
sysexits_bin: src/sysexits.c
2022-06-26 20:34:29 +00:00
$(CC) $(CFLAGS) -c -o build/sysexits.o src/sysexits.c
$(CC) $(CFLAGS) -o bin/sysexits build/sysexits.o
2022-05-27 21:58:49 +00:00
sysexits: sysexits_bin
2022-05-15 00:52:07 +00:00
bin/sysexits >include/sysexits.h
2022-08-20 01:29:46 +00:00
programs: echo false id lowercase nonzero pscat roll simexec sleep streq str true
2022-05-15 00:52:07 +00:00
calculate: libstr sysexits src/calculate.c
$(CC) $(CFLAGS) -o src/calculate.o -c src/calculate.c
$(CC) $(CFLAGS) -o bin/calculate lib/libstr.o src/calculate.o
2022-09-16 14:56:10 +00:00
echo: bin/echo
2022-06-26 20:34:29 +00:00
2022-09-16 14:56:10 +00:00
bin/echo: echo/echo
2022-09-16 14:58:18 +00:00
cp echo/echo bin/echo
2022-09-16 14:56:10 +00:00
echo/echo: echo/Makefile echo/echo.c
$(MAKE) -C echo sane
2022-05-15 00:52:07 +00:00
false: src/false.c
$(CC) $(CFLAGS) -o bin/false src/false.c
id: stdbool sysexits src/id.c
$(CC) $(CFLAGS) -o bin/id src/id.c
levenshtein: src/levenshtein.c
$(CC) $(CFLAGS) -o bin/levenshtein src/levenshtein.c
lowercase: sysexits src/lowercase.c
$(CC) $(CFLAGS) -o bin/lowercase src/lowercase.c
2022-09-17 04:31:52 +00:00
nonzero: bin/nonzero
bin/nonzero: nonzero/nonzero
cp nonzero/nonzero bin/nonzero
nonzero/nonzero: nonzero/Makefile nonzero/nonzero.c
$(MAKE) -C nonzero sane
2022-05-15 00:52:07 +00:00
2022-07-08 00:50:19 +00:00
nutshell.o: libio usefulmacros src/nutshell.c src/nutshell.h src/nutshell_builtins.c
$(CC) $(CFLAGS) -c -o build/nutshell.o src/nutshell.c
nutshell: libio nutshell.o
$(CC) $(CFLAGS) -o bin/nutshell build/libio.o build/nutshell.o
2022-06-06 20:06:56 +00:00
2022-09-13 04:52:52 +00:00
pscat: bin/pscat
2022-07-19 20:52:28 +00:00
2022-09-13 04:52:52 +00:00
bin/pscat: pscat/pscat
2022-09-16 14:58:18 +00:00
cp pscat/pscat bin/pscat
2022-09-13 04:52:52 +00:00
pscat/pscat: sysexits pscat/pscat.c pscat/Makefile
$(MAKE) -C pscat sane
2022-07-19 20:52:28 +00:00
2022-08-23 16:49:42 +00:00
retval.o: libio src/retval.c sysexits
$(CC) $(CFLAGS) -c -o build/retval.o src/retval.c
retval: libio retval.o
$(CC) $(CFLAGS) -o bin/retval build/retval.o build/libio.o
2022-09-13 04:52:52 +00:00
roll: bin/roll
bin/roll: roll/roll
2022-09-16 14:58:18 +00:00
cp roll/roll bin/roll
2022-06-14 21:07:27 +00:00
2022-09-13 04:02:15 +00:00
roll/roll: sysexits roll/roll.c roll/Makefile
$(MAKE) -C roll sane
2022-08-20 01:29:46 +00:00
2022-09-13 04:52:52 +00:00
rot13: bin/rot13
bin/rot13: rot13/rot13
2022-09-16 14:58:18 +00:00
cp rot13/rot13 bin/rot13
2022-08-23 15:40:45 +00:00
2022-09-13 03:28:28 +00:00
rot13/rot13: sysexits rot13/rot13.c rot13/Makefile
$(MAKE) -C rot13 sane
2022-08-23 15:40:45 +00:00
2022-06-18 10:28:15 +00:00
rldecode.o: sysexits src/runlength.c
$(CC) $(CFLAGS) -Df=decode -c -o build/rldecode.o src/runlength.c
rlencode.o: sysexits src/runlength.c
$(CC) $(CFLAGS) -Df=encode -c -o build/rlencode.o src/runlength.c
runlength: rldecode.o rlencode.o
$(CC) $(CFLAGS) -o bin/rldecode build/rldecode.o
$(CC) $(CFLAGS) -o bin/rlencode build/rlencode.o
2022-05-15 00:52:07 +00:00
2022-06-14 21:34:17 +00:00
simexec.o: libio sysexits src/simexec.c
$(CC) $(CFLAGS) -c -o build/simexec.o src/simexec.c
simexec: libio simexec.o
$(CC) $(CFLAGS) -o bin/simexec build/libio.o build/simexec.o
2022-05-15 00:52:07 +00:00
2022-06-14 21:37:48 +00:00
streq.o: libio sysexits src/streq.c
$(CC) $(CFLAGS) -c -o build/streq.o src/streq.c
streq: libio streq.o
$(CC) $(CFLAGS) -o bin/streq build/libio.o build/streq.o
2022-05-15 00:52:07 +00:00
2022-09-14 03:54:18 +00:00
str: bin/str
2022-06-14 21:07:27 +00:00
2022-09-14 03:54:18 +00:00
bin/str: str/str
2022-09-16 14:58:18 +00:00
cp str/str bin/str
2022-09-14 03:54:18 +00:00
str/str: sysexits str/str.c str/Makefile
$(MAKE) -C str sane
2022-05-15 00:52:07 +00:00
2022-06-14 21:07:27 +00:00
sleep.o: libio sysexits src/sleep.c usefulmacros
$(CC) $(CFLAGS) -c -o build/sleep.o src/sleep.c
sleep: libio sleep.o
$(CC) $(CFLAGS) -o bin/sleep build/libio.o build/sleep.o
2022-05-15 00:52:07 +00:00
substitute: stdbool src/substitute.c
$(CC) $(CFLAGS) -c -o src/substitute.o src/substitute.c
$(CC) $(CFLAGS) -o bin/substitute src/substitute.o
2022-06-26 20:34:29 +00:00
tail.o: libio src/tail.c
$(CC) $(CFLAGS) -c -o build/tail.o src/tail.c
tail: libio tail.o
$(CC) $(CFLAGS) -o bin/tail build/libio.o build/tail.o
2022-06-26 20:50:41 +00:00
true: src/true.c
$(CC) $(CFLAGS) -o bin/true src/true.c
2022-06-14 21:07:27 +00:00
usefulmacros: include/usefulmacros.h
2022-05-15 00:52:07 +00:00
which: libshell src/which.c
$(CC) $(CFLAGS) -c -o src/which.o src/which.c
$(CC) $(CFLAGS) -o bin/which lib/libshell.o src/which.o
2022-05-27 21:58:49 +00:00
# Convenience
PROGRAMS= \
alsa-plugins-nice alsa-utils \
anki audacious \
curl wget \
dvdbackup ffmpeg mpv \
vlc \
awk nawk sed moreutils \
ed vim \
feh ffmpeg imagemagick \
gcc \
git mercurial \
gparted \
gperf gwenview \
htop powertop \
inetutils iptables k3b \
kate kdenlive krita \
lame linux-headers lynx \
macchanger make \
man-pages man-pages-posix \
moc \
net-tools \
nmap p7zip pkgfile \
progress \
pulseaudio pulseaudio-alsa pulseaudio-utils \
pulsemixer \
python3 qbittorrent qemu \
rsync s-tui \
screen tmux twin \
scrot sed smartmontools \
thunar thunderbird \
ttf-liberation tlp \
units \
unrar unzip \
util-linux \
virt-manager \
wireguard-tools \
xclip \
xf86-input-libinput xf86-input-wacom xf86-video-intel \
xscreensaver xterm \
zathura zathura-cb zathura-djvu \
zathura-ps
2022-06-03 00:11:41 +00:00
alpine-programs:
2022-05-27 21:58:49 +00:00
apk add $(PROGRAMS)
2022-06-03 00:16:29 +00:00
arch-doas:
cd dist/doas-sudo
makepkg -si
2022-06-03 00:11:41 +00:00
arch-yay:
git clone "https://aur.archlinux.org/yay.git" || true
cd yay
git pull
makepkg -si
yay -V
2022-06-03 00:20:17 +00:00
audacious-skins:
curl https://archive.org/download/winampskin_Sailor_Moon_Gang/Sailor_Moon_Gang.wsz -o /usr/share/audacious/Skins/Sailor_Moon_Gang.wsz
2022-06-03 00:29:00 +00:00
# i made this script to fetch icons for my grandmother and put them in icons/
# so i wouldn't have to fetch the icons for her desktop when i made her a new
# system.
# i could have downloaded all the icons and put them into a repo for her but
# this uses less space
# all these icons are on the internet archive so if the local sites change
# they'll still be available
grammy-icons:
mkdir -p "~/Pictures/icons/"
cd "~/Pictures/icons/"
curl -o "989wclz.com.png" "https://web.archive.org/web/20200629174002if_/https://989wclz.com/wp-content/themes/wclz/img/touch-icon-144.png"
curl -o "amazon.com.ico" "https://web.archive.org/web/20200718050400if_/https://www.amazon.com/favicon.ico"
curl -o "bangordailynews.com.png" "http://web.archive.org/web/20200721195123if_/https://i0.wp.com/bdn-data.s3.amazonaws.com/uploads/2020/06/BDN-logo_green-3-1.png"
curl -o "theguardian.com.png" "https://web.archive.org/web/20200720041457if_/https://assets.guim.co.uk/images/favicons/fee5e2d638d1c35f6d501fa397e53329/152x152.png"
curl -o "centralmaine.com.png" "https://web.archive.org/web/20200720023956if_/https://multifiles.pressherald.com/uploads/sites/2/2014/06/apple-touch-icon-iphone-retina-display.png"
curl -o "dictionary.com.png" "https://web.archive.org/web/20200719135458if_/https://www.dictionary.com/hp-assets/dcom_favicon-1bff2f1b49c077ed504e55c3649f2a4b.png"
curl -o "google.com.jpg" "https://web.archive.org/web/20170621105937if_/https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no/photo.jpg"
curl -o "longfellowsgreenhouses.com.jpg" "https://web.archive.org/web/20200718173559im_/https://longfellowsgreenhouses.com/wp-content/uploads/2020/03/Longfellows-Logo-Light-Green.jpg"
curl -o "mainepublic.org.png" "https://d3kle7qwymxpcy.cloudfront.net/images/broadcasts/e5/8e/30457/1/c300.png"
curl -o "news.google.com.png" "https://upload.wikimedia.org/wikipedia/commons/0/0b/Google_News_icon.png"
curl -o "newscentermaine.com.png" "https://web.archive.org/web/20200721190548if_/https://www.newscentermaine.com/assets/favicons/WCSH.png?ver=2.4.7.4"
curl -o "pressherald.com.png" "https://multifiles.pressherald.com/uploads/sites/4/2014/06/apple-touch-icon-iphone-retina-display.png"
curl -o "weather.com.png" "https://upload.wikimedia.org/wikipedia/commons/thumb/7/77/The_Weather_Channel_logo_2005-present.svg/1200px-The_Weather_Channel_logo_2005-present.svg.png"
2022-06-03 00:25:27 +00:00
# nmap 7.80 is the last Free nmap release
nmap:
mkdir -p ~/src
cd ~/src
curl "https://nmap.org/dist/nmap-7.80.tar.bz2" | bzip2 -cd | tar -x
./configure
make
2022-05-27 22:05:00 +00:00
spacer:
# creates an 8GB empty file in the root dir
# that way when the alarm bells go off you can delete it to save a
# couple minutes before the system really runs out of disk
#
# 512 * 16777216 = 8GB
dd bs=512 count=16777216 </dev/zero >/spacer.bin
2022-06-14 21:07:27 +00:00
unscii-pkgsrc:
cd /usr/pkgsrc/fonts/unscii
make install clean clean-depends
2022-06-03 00:11:41 +00:00
2022-06-14 21:07:27 +00:00
unscii-system:
2022-06-03 00:11:41 +00:00
mkdir -p /usr/share/fonts/unscii
curl "http://viznut.fi/unscii/unscii-16-full.otf" >"/usr/share/fonts/unscii/unscii-16-full.otf"
curl "http://viznut.fi/unscii/unscii-16-full.pcf" >"/usr/share/fonts/unscii/unscii-16-full.pcf"
curl "http://viznut.fi/unscii/unscii-16-full.ttf" >"/usr/share/fonts/unscii/unscii-16-full.ttf"
2022-06-14 21:07:27 +00:00
unscii-user:
mkdir -p ~/.fonts
curl "http://viznut.fi/unscii/unscii-16-full.otf" >"~/.fonts/unscii-16-full.otf"
curl "http://viznut.fi/unscii/unscii-16-full.pcf" >"~/.fonts/unscii-16-full.pcf"
curl "http://viznut.fi/unscii/unscii-16-full.ttf" >"~/.fonts/unscii-16-full.ttf"
2022-09-17 04:31:52 +00:00
.PHONY: all clean cleanlibraries cleanprograms echo nonzero pscat roll rot13 stdbool str sysexits usefulmacros