sbase

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

Makefile (3633B)


      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/random.o\
     90 	libutil/unescape.o\
     91 	libutil/writeall.o
     92 
     93 LIB = libutf.a libutil.a
     94 
     95 BIN =\
     96 	basename\
     97 	cal\
     98 	cat\
     99 	chgrp\
    100 	chmod\
    101 	chown\
    102 	chroot\
    103 	cksum\
    104 	cmp\
    105 	cols\
    106 	comm\
    107 	cp\
    108 	cron\
    109 	cut\
    110 	date\
    111 	dd\
    112 	dirname\
    113 	du\
    114 	echo\
    115 	ed\
    116 	env\
    117 	expand\
    118 	expr\
    119 	false\
    120 	find\
    121 	flock\
    122 	fold\
    123 	getconf\
    124 	grep\
    125 	head\
    126 	hostname\
    127 	join\
    128 	kill\
    129 	link\
    130 	ln\
    131 	logger\
    132 	logname\
    133 	ls\
    134 	md5sum\
    135 	mkdir\
    136 	mkfifo\
    137 	mknod\
    138 	mktemp\
    139 	mv\
    140 	nice\
    141 	nl\
    142 	nohup\
    143 	od\
    144 	paste\
    145 	pathchk\
    146 	printenv\
    147 	printf\
    148 	pwd\
    149 	readlink\
    150 	renice\
    151 	rev\
    152 	rm\
    153 	rmdir\
    154 	sed\
    155 	seq\
    156 	setsid\
    157 	sha1sum\
    158 	sha224sum\
    159 	sha256sum\
    160 	sha384sum\
    161 	sha512sum\
    162 	sha512-224sum\
    163 	sha512-256sum\
    164 	sleep\
    165 	sort\
    166 	split\
    167 	sponge\
    168 	strings\
    169 	sync\
    170 	tail\
    171 	tar\
    172 	tee\
    173 	test\
    174 	tftp\
    175 	time\
    176 	touch\
    177 	tr\
    178 	true\
    179 	tsort\
    180 	tty\
    181 	uname\
    182 	unexpand\
    183 	uniq\
    184 	unlink\
    185 	uudecode\
    186 	uuencode\
    187 	wc\
    188 	which\
    189 	whoami\
    190 	xargs\
    191 	xinstall\
    192 	yes
    193 
    194 OBJ = $(LIBUTFOBJ) $(LIBUTILOBJ)
    195 
    196 all: $(BIN)
    197 
    198 $(BIN): $(LIB)
    199 
    200 $(OBJ) $(BIN): $(HDR)
    201 
    202 .o:
    203 	$(CC) $(LDFLAGS) -o $@ $< $(LIB)
    204 
    205 .c.o:
    206 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
    207 
    208 .c:
    209 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LIB)
    210 
    211 libutf.a: $(LIBUTFOBJ)
    212 	$(AR) $(ARFLAGS) $@ $?
    213 	$(RANLIB) $@
    214 
    215 libutil.a: $(LIBUTILOBJ)
    216 	$(AR) $(ARFLAGS) $@ $?
    217 	$(RANLIB) $@
    218 
    219 getconf.o: getconf.h
    220 
    221 getconf.h:
    222 	scripts/getconf.sh > $@
    223 
    224 proto: $(BIN)
    225 	scripts/mkproto $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
    226 
    227 install uninstall: proto
    228 	scripts/$@ proto
    229 
    230 sbase-box-install: sbase-box proto
    231 	scripts/install proto
    232 	$(DESTDIR)$(PREFIX)/bin/sbase-box -i $(DESTDIR)$(PREFIX)/bin/
    233 
    234 sbase-box-uninstall: sbase-box proto
    235 	$(DESTDIR)$(PREFIX)/bin/sbase-box -d $(DESTDIR)$(PREFIX)/bin/
    236 	scripts/uninstall proto
    237 
    238 dist: clean
    239 	mkdir -p sbase-$(VERSION)
    240 	cp -r LICENSE Makefile README TODO config.mk *.c *.1 *.h libutf libutil sbase-$(VERSION)
    241 	tar -cf sbase-$(VERSION).tar sbase-$(VERSION)
    242 	gzip sbase-$(VERSION).tar
    243 	rm -rf sbase-$(VERSION)
    244 
    245 sbase-box: $(BIN)
    246 	scripts/mkbox
    247 	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ build/*.c $(LIB)
    248 
    249 clean:
    250 	rm -f $(BIN) $(OBJ) $(LIB) sbase-box sbase-$(VERSION).tar.gz
    251 	rm -f getconf.h
    252 	rm -f proto
    253 	rm -rf build
    254 
    255 .PHONY: all install uninstall dist sbase-box-install sbase-box-uninstall clean