diff options
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/Makefile b/src/Makefile index 3de2a68..82ac0b1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,30 +6,18 @@ CFLAGS=-Wall -Wextra -Wpedantic LDFLAGS= LIBS=-ll -ly -OBJS= ar.o asa.o \ - basename.o \ - cal.o cat.o chgrp.o chmod.o chown.o cksum.o cmp.o cp.o crontab.o ctags.o \ - date.o dd.o dirname.o du.o \ - ed.o env.o ex.o expand.o \ - file.o \ - getconf.o grep.o \ - head.o \ - iconv.o id.o \ - link.o ln.o locale.o logger.o logname.o ls.o \ - mkdir.o mkfifo.o more.o \ - nice.o nohup.o \ - od.o \ - paste.o pathchk.o printf.o \ - renice.o rm.o rmdir.o \ - sh.o sleep.o split.o strings.o stty.o sum.o \ - tail.o tee.o tput.o tr.o \ - uname.o unlink.o uudecode.o uuencode.o \ - wc.o who.o write.o +include .deps.mk +include .objs.mk bosix: $(OBJS) $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) -sh.o: sh.c mains.h builtins.h +deps: + printf '.POSIX:\n\n' > .deps.mk + for i in *.c; do printf '%s.o: %s ' "$$(basename $$i .c)" "$$i"; grep include "$$i" | sed -e 's/^.*"\(.*\)".*/\1/g' | paste -d' ' -s -; printf '\t$$(CC) -c $$(CFLAGS) %s\n\n' "$$i"; done >> .deps.mk + printf '.POSIX:\n\nOBJS=' > .objs.mk + for i in *.c; do printf '\\\n\t%s.o' $$(basename $$i .c); done >> .objs.mk + printf '\n' >> .objs.mk clean: rm -f bosix *.o |