sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

Makefile (3614B)


      1 .POSIX:
      2 include config.mk
      3 
      4 .SUFFIXES:
      5 .SUFFIXES: .o .c
      6 
      7 CPPFLAGS =\
      8 	-D_DEFAULT_SOURCE \
      9 	-D_NETBSD_SOURCE \
     10 	-D_BSD_SOURCE \
     11 	-D_XOPEN_SOURCE=700 \
     12 	-D_FILE_OFFSET_BITS=64
     13 
     14 HDR =\
     15 	arg.h\
     16 	compat.h\
     17 	crypt.h\
     18 	fs.h\
     19 	md5.h\
     20 	queue.h\
     21 	sha1.h\
     22 	sha224.h\
     23 	sha256.h\
     24 	sha384.h\
     25 	sha512.h\
     26 	sha512-224.h\
     27 	sha512-256.h\
     28 	text.h\
     29 	utf.h\
     30 	util.h
     31 
     32 LIBUTFOBJ =\
     33 	libutf/fgetrune.o\
     34 	libutf/fputrune.o\
     35 	libutf/isalnumrune.o\
     36 	libutf/isalpharune.o\
     37 	libutf/isblankrune.o\
     38 	libutf/iscntrlrune.o\
     39 	libutf/isdigitrune.o\
     40 	libutf/isgraphrune.o\
     41 	libutf/isprintrune.o\
     42 	libutf/ispunctrune.o\
     43 	libutf/isspacerune.o\
     44 	libutf/istitlerune.o\
     45 	libutf/isxdigitrune.o\
     46 	libutf/lowerrune.o\
     47 	libutf/rune.o\
     48 	libutf/runetype.o\
     49 	libutf/upperrune.o\
     50 	libutf/utf.o\
     51 	libutf/utftorunestr.o
     52 
     53 LIBUTILOBJ =\
     54 	libutil/concat.o\
     55 	libutil/cp.o\
     56 	libutil/crypt.o\
     57 	libutil/ealloc.o\
     58 	libutil/enmasse.o\
     59 	libutil/eprintf.o\
     60 	libutil/eregcomp.o\
     61 	libutil/estrtod.o\
     62 	libutil/fnck.o\
     63 	libutil/fshut.o\
     64 	libutil/getlines.o\
     65 	libutil/human.o\
     66 	libutil/linecmp.o\
     67 	libutil/md5.o\
     68 	libutil/memmem.o\
     69 	libutil/mkdirp.o\
     70 	libutil/mode.o\
     71 	libutil/parseoffset.o\
     72 	libutil/putword.o\
     73 	libutil/reallocarray.o\
     74 	libutil/recurse.o\
     75 	libutil/rm.o\
     76 	libutil/sha1.o\
     77 	libutil/sha224.o\
     78 	libutil/sha256.o\
     79 	libutil/sha384.o\
     80 	libutil/sha512.o\
     81 	libutil/sha512-224.o\
     82 	libutil/sha512-256.o\
     83 	libutil/strcasestr.o\
     84 	libutil/strlcat.o\
     85 	libutil/strlcpy.o\
     86 	libutil/strsep.o\
     87 	libutil/strnsubst.o\
     88 	libutil/strtonum.o\
     89 	libutil/unescape.o\
     90 	libutil/writeall.o
     91 
     92 LIB = libutf.a libutil.a
     93 
     94 BIN =\
     95 	basename\
     96 	cal\
     97 	cat\
     98 	chgrp\
     99 	chmod\
    100 	chown\
    101 	chroot\
    102 	cksum\
    103 	cmp\
    104 	cols\
    105 	comm\
    106 	cp\
    107 	cron\
    108 	cut\
    109 	date\
    110 	dd\
    111 	dirname\
    112 	du\
    113 	echo\
    114 	ed\
    115 	env\
    116 	expand\
    117 	expr\
    118 	false\
    119 	find\
    120 	flock\
    121 	fold\
    122 	getconf\
    123 	grep\
    124 	head\
    125 	hostname\
    126 	join\
    127 	kill\
    128 	link\
    129 	ln\
    130 	logger\
    131 	logname\
    132 	ls\
    133 	md5sum\
    134 	mkdir\
    135 	mkfifo\
    136 	mknod\
    137 	mktemp\
    138 	mv\
    139 	nice\
    140 	nl\
    141 	nohup\
    142 	od\
    143 	paste\
    144 	pathchk\
    145 	printenv\
    146 	printf\
    147 	pwd\
    148 	readlink\
    149 	renice\
    150 	rev\
    151 	rm\
    152 	rmdir\
    153 	sed\
    154 	seq\
    155 	setsid\
    156 	sha1sum\
    157 	sha224sum\
    158 	sha256sum\
    159 	sha384sum\
    160 	sha512sum\
    161 	sha512-224sum\
    162 	sha512-256sum\
    163 	sleep\
    164 	sort\
    165 	split\
    166 	sponge\
    167 	strings\
    168 	sync\
    169 	tail\
    170 	tar\
    171 	tee\
    172 	test\
    173 	tftp\
    174 	time\
    175 	touch\
    176 	tr\
    177 	true\
    178 	tsort\
    179 	tty\
    180 	uname\
    181 	unexpand\
    182 	uniq\
    183 	unlink\
    184 	uudecode\
    185 	uuencode\
    186 	wc\
    187 	which\
    188 	whoami\
    189 	xargs\
    190 	xinstall\
    191 	yes
    192 
    193 OBJ = $(LIBUTFOBJ) $(LIBUTILOBJ)
    194 
    195 all: $(BIN)
    196 
    197 $(BIN): $(LIB)
    198 
    199 $(OBJ) $(BIN): $(HDR)
    200 
    201 .o:
    202 	$(CC) $(LDFLAGS) -o $@ $< $(LIB)
    203 
    204 .c.o:
    205 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
    206 
    207 .c:
    208 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LIB)
    209 
    210 libutf.a: $(LIBUTFOBJ)
    211 	$(AR) $(ARFLAGS) $@ $?
    212 	$(RANLIB) $@
    213 
    214 libutil.a: $(LIBUTILOBJ)
    215 	$(AR) $(ARFLAGS) $@ $?
    216 	$(RANLIB) $@
    217 
    218 getconf.o: getconf.h
    219 
    220 getconf.h:
    221 	scripts/getconf.sh > $@
    222 
    223 proto: $(BIN)
    224 	scripts/mkproto $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
    225 
    226 install uninstall: proto
    227 	scripts/$@ proto
    228 
    229 sbase-box-install: sbase-box proto
    230 	scripts/install proto
    231 	$(DESTDIR)$(PREFIX)/bin/sbase-box -i $(DESTDIR)$(PREFIX)/bin/
    232 
    233 sbase-box-uninstall: sbase-box proto
    234 	$(DESTDIR)$(PREFIX)/bin/sbase-box -d $(DESTDIR)$(PREFIX)/bin/
    235 	scripts/uninstall proto
    236 
    237 dist: clean
    238 	mkdir -p sbase-$(VERSION)
    239 	cp -r LICENSE Makefile README TODO config.mk *.c *.1 *.h libutf libutil sbase-$(VERSION)
    240 	tar -cf sbase-$(VERSION).tar sbase-$(VERSION)
    241 	gzip sbase-$(VERSION).tar
    242 	rm -rf sbase-$(VERSION)
    243 
    244 sbase-box: $(BIN)
    245 	scripts/mkbox
    246 	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ build/*.c $(LIB)
    247 
    248 clean:
    249 	rm -f $(BIN) $(OBJ) $(LIB) sbase-box sbase-$(VERSION).tar.gz
    250 	rm -f getconf.h
    251 	rm -f proto
    252 	rm -rf build
    253 
    254 .PHONY: all install uninstall dist sbase-box-install sbase-box-uninstall clean