diff --git a/Makefile b/Makefile index d096122..5024389 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,8 @@ # System utilities CC=cc -CFLAGS=-I include/ -I lib/ -Wall +CFLAGS=-Iinclude/ -Ilib/ -g -Wall RM=rm -f -working: id - all: libraries programs cleanall: clean cleanlibraries cleanprograms @@ -32,11 +30,14 @@ cleanprograms: $(RM) bin/simexec $(RM) bin/sleep $(RM) bin/streq - $(RM) bin/stris + $(RM) bin/str $(RM) bin/substitute $(RM) bin/tail -libraries: libshell libstr stdbool sysexits +libraries: libio libshell stdbool sysexits + +libio: lib/libio.c + $(CC) $(CFLAGS) -c -o build/libio.o lib/libio.c libshell: lib/libshell.c lib/libshell.h $(CC) $(CFLAGS) -o lib/libshell.o -c lib/libshell.c @@ -52,7 +53,7 @@ sysexits_bin: src/sysexits.c sysexits: sysexits_bin bin/sysexits >include/sysexits.h -programs: echo false nonzero simexec sleep streq stris +programs: echo false id lowercase nonzero simexec sleep streq str calculate: libstr sysexits src/calculate.c $(CC) $(CFLAGS) -o src/calculate.o -c src/calculate.c @@ -79,27 +80,39 @@ nonzero: src/nonzero.c nutshell: src/nutshell.c src/nutshell.h src/nutshell_builtins.c $(CC) $(CFLAGS) -o bin/nutshell src/nutshell.c -runlength: noargvzero sysexits src/runlength.c +roll.o: lib/libio.h src/roll.c sysexits + $(CC) $(CFLAGS) -c -o build/roll.o src/roll.c + +roll: libio sysexits roll.o + $(CC) $(CFLAGS) -o bin/roll build/libio.o build/roll.o + +runlength: sysexits src/runlength.c usefulmacros $(CC) $(CFLAGS) -o bin/runlength src/runlength.c -simexec: noargvzero sysexits src/simexec.c +simexec: sysexits src/simexec.c usefulmacros $(CC) $(CFLAGS) -o bin/simexec src/simexec.c -streq: noargvzero sysexits src/streq.c +streq: sysexits src/streq.c usefulmacros $(CC) $(CFLAGS) -o bin/streq src/streq.c -stris: libstr src/stris.c - $(CC) $(CFLAGS) -c -o src/stris.o src/stris.c - $(CC) $(CFLAGS) -o bin/stris lib/libstr.o src/stris.o +str.o: src/str.c + $(CC) $(CFLAGS) -o build/str.o src/str.c -sleep: libstr noargvzero sysexits src/sleep.c - $(CC) $(CFLAGS) -c -o src/sleep.o src/sleep.c - $(CC) $(CFLAGS) -o bin/sleep lib/libstr.o src/sleep.o +str: libio str.o + $(CC) $(CFLAGS) -o bin/str lib/libio.o src/str.o + +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 substitute: stdbool src/substitute.c $(CC) $(CFLAGS) -c -o src/substitute.o src/substitute.c $(CC) $(CFLAGS) -o bin/substitute src/substitute.o +usefulmacros: include/usefulmacros.h + 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 @@ -206,16 +219,20 @@ spacer: # 512 * 16777216 = 8GB dd bs=512 count=16777216 /spacer.bin -unscii-system: - 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" +unscii-pkgsrc: + cd /usr/pkgsrc/fonts/unscii + make install clean clean-depends -unscii-user: +unscii-system: 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" -.PHONY: all clean cleanlibraries cleanprograms noargvzero stdbool sysexits +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" + +.PHONY: all clean cleanlibraries cleanprograms stdbool sysexits usefulmacros