sbase/Makefile

260 lines
4.3 KiB
Makefile
Raw Normal View History

2011-05-23 01:36:34 +00:00
include config.mk
.SUFFIXES:
.SUFFIXES: .o .c
HDR =\
arg.h\
2014-11-17 15:45:09 +00:00
compat.h\
crypt.h\
fs.h\
md5.h\
queue.h\
sha1.h\
sha224.h\
sha256.h\
sha384.h\
sha512.h\
sha512-224.h\
sha512-256.h\
text.h\
utf.h\
2014-11-13 18:20:51 +00:00
util.h
LIBUTFOBJ =\
libutf/fgetrune.o\
libutf/fputrune.o\
libutf/isalnumrune.o\
libutf/isalpharune.o\
libutf/isblankrune.o\
libutf/iscntrlrune.o\
libutf/isdigitrune.o\
libutf/isgraphrune.o\
libutf/isprintrune.o\
libutf/ispunctrune.o\
libutf/isspacerune.o\
libutf/istitlerune.o\
libutf/isxdigitrune.o\
libutf/lowerrune.o\
libutf/rune.o\
libutf/runetype.o\
libutf/upperrune.o\
libutf/utf.o\
libutf/utftorunestr.o
LIBUTILOBJ =\
libutil/concat.o\
libutil/cp.o\
libutil/crypt.o\
libutil/ealloc.o\
libutil/enmasse.o\
libutil/eprintf.o\
libutil/eregcomp.o\
libutil/estrtod.o\
libutil/fnck.o\
libutil/fshut.o\
libutil/getlines.o\
libutil/human.o\
libutil/linecmp.o\
libutil/md5.o\
libutil/memmem.o\
libutil/mkdirp.o\
libutil/mode.o\
libutil/parseoffset.o\
libutil/putword.o\
libutil/reallocarray.o\
libutil/recurse.o\
libutil/rm.o\
libutil/sha1.o\
libutil/sha224.o\
libutil/sha256.o\
libutil/sha384.o\
libutil/sha512.o\
libutil/sha512-224.o\
libutil/sha512-256.o\
libutil/strcasestr.o\
libutil/strlcat.o\
libutil/strlcpy.o\
libutil/strsep.o\
libutil/strnsubst.o\
libutil/strtonum.o\
libutil/unescape.o\
libutil/writeall.o
LIB = libutf.a libutil.a
BIN =\
basename\
cal\
cat\
chgrp\
chmod\
chown\
chroot\
cksum\
cmp\
cols\
comm\
cp\
2014-12-16 10:59:08 +00:00
cron\
cut\
date\
2020-04-29 05:22:37 +00:00
dd\
dirname\
du\
echo\
2015-12-14 12:09:34 +00:00
ed\
env\
expand\
expr\
false\
find\
flock\
fold\
getconf\
grep\
head\
hostname\
2016-10-20 16:06:18 +00:00
join\
kill\
link\
ln\
logger\
logname\
ls\
md5sum\
mkdir\
mkfifo\
mknod\
mktemp\
mv\
nice\
nl\
nohup\
od\
paste\
2016-10-20 16:06:18 +00:00
pathchk\
printenv\
printf\
pwd\
readlink\
renice\
rev\
rm\
rmdir\
sed\
2014-12-01 17:12:07 +00:00
seq\
setsid\
2014-12-01 17:12:07 +00:00
sha1sum\
sha224sum\
2014-12-01 17:12:07 +00:00
sha256sum\
sha384sum\
2014-12-01 17:12:07 +00:00
sha512sum\
sha512-224sum\
sha512-256sum\
2014-12-01 17:12:07 +00:00
sleep\
sort\
split\
sponge\
strings\
sync\
tail\
tar\
tee\
test\
tftp\
time\
touch\
tr\
true\
tsort\
tty\
uname\
unexpand\
uniq\
unlink\
2014-12-01 17:12:07 +00:00
uudecode\
uuencode\
wc\
2015-04-27 14:24:43 +00:00
which\
whoami\
xargs\
2016-02-15 08:44:35 +00:00
xinstall\
yes
OBJ = $(BIN:=.o) $(LIBUTFOBJ) $(LIBUTILOBJ)
2016-02-15 08:44:35 +00:00
SRC = $(BIN:=.c)
MAN = $(BIN:=.1)
2011-05-23 01:36:34 +00:00
all: $(BIN)
$(BIN): $(LIB) $(@:=.o)
2011-05-23 01:36:34 +00:00
$(OBJ): $(HDR) config.mk
2011-05-23 01:36:34 +00:00
.o:
$(CC) $(LDFLAGS) -o $@ $< $(LIB)
2011-05-23 01:36:34 +00:00
.c.o:
2014-11-17 10:31:29 +00:00
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
2011-05-24 12:00:30 +00:00
libutf.a: $(LIBUTFOBJ)
$(AR) rc $@ $?
2014-11-19 10:50:54 +00:00
$(RANLIB) $@
libutil.a: $(LIBUTILOBJ)
$(AR) rc $@ $?
2014-11-17 12:22:53 +00:00
$(RANLIB) $@
2011-05-23 01:36:34 +00:00
getconf.o: getconf.h
getconf.h: getconf.sh
./getconf.sh > $@
2011-06-08 15:26:05 +00:00
install: all
2014-11-17 10:15:44 +00:00
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
2016-02-15 08:44:35 +00:00
cd $(DESTDIR)$(PREFIX)/bin && ln -f test [ && chmod 755 $(BIN)
mv -f $(DESTDIR)$(PREFIX)/bin/xinstall $(DESTDIR)$(PREFIX)/bin/install
2014-11-17 10:15:44 +00:00
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
for m in $(MAN); do sed "s/^\.Os sbase/.Os sbase $(VERSION)/g" < "$$m" > $(DESTDIR)$(MANPREFIX)/man1/"$$m"; done
2014-11-17 10:15:44 +00:00
cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN)
2016-02-15 08:44:35 +00:00
mv -f $(DESTDIR)$(MANPREFIX)/man1/xinstall.1 $(DESTDIR)$(MANPREFIX)/man1/install.1
2011-06-08 10:37:00 +00:00
uninstall:
cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN) [ install
cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN) install.1
2011-06-08 10:37:00 +00:00
2011-05-23 01:36:34 +00:00
dist: clean
2014-11-17 10:15:44 +00:00
mkdir -p sbase-$(VERSION)
2014-11-17 16:48:01 +00:00
cp -r LICENSE Makefile README TODO config.mk $(SRC) $(MAN) libutf libutil $(HDR) sbase-$(VERSION)
2014-11-17 10:15:44 +00:00
tar -cf sbase-$(VERSION).tar sbase-$(VERSION)
gzip sbase-$(VERSION).tar
rm -rf sbase-$(VERSION)
2011-05-23 01:36:34 +00:00
sbase-box: $(BIN)
scripts/mkbox
2015-09-03 18:07:16 +00:00
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ build/*.c $(LIB)
2011-06-16 00:53:33 +00:00
sbase-box-install: sbase-box
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f sbase-box $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/sbase-box
2016-02-15 08:44:35 +00:00
for f in $(BIN); do ln -sf sbase-box $(DESTDIR)$(PREFIX)/bin/"$$f"; done
ln -sf sbase-box $(DESTDIR)$(PREFIX)/bin/[
2016-02-15 08:44:35 +00:00
mv -f $(DESTDIR)$(PREFIX)/bin/xinstall $(DESTDIR)$(PREFIX)/bin/install
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
for m in $(MAN); do sed "s/^\.Os sbase/.Os sbase $(VERSION)/g" < "$$m" > $(DESTDIR)$(MANPREFIX)/man1/"$$m"; done
cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN)
2016-02-15 08:44:35 +00:00
mv -f $(DESTDIR)$(MANPREFIX)/man1/xinstall.1 $(DESTDIR)$(MANPREFIX)/man1/install.1
sbase-box-uninstall: uninstall
cd $(DESTDIR)$(PREFIX)/bin && rm -f sbase-box
2011-05-23 01:36:34 +00:00
clean:
rm -f $(BIN) $(OBJ) $(LIB) sbase-box sbase-$(VERSION).tar.gz
rm -f getconf.h
rm -rf build
2014-11-17 13:02:17 +00:00
.PHONY: all install uninstall dist sbase-box-install sbase-box-uninstall clean