sbase

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

Makefile (3925B)


      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/confirm.o\
     58 	libutil/ealloc.o\
     59 	libutil/enmasse.o\
     60 	libutil/eprintf.o\
     61 	libutil/eregcomp.o\
     62 	libutil/estrtod.o\
     63 	libutil/fnck.o\
     64 	libutil/fshut.o\
     65 	libutil/getlines.o\
     66 	libutil/human.o\
     67 	libutil/linecmp.o\
     68 	libutil/md5.o\
     69 	libutil/memmem.o\
     70 	libutil/mkdirp.o\
     71 	libutil/mode.o\
     72 	libutil/parseoffset.o\
     73 	libutil/putword.o\
     74 	libutil/reallocarray.o\
     75 	libutil/recurse.o\
     76 	libutil/rm.o\
     77 	libutil/sha1.o\
     78 	libutil/sha224.o\
     79 	libutil/sha256.o\
     80 	libutil/sha384.o\
     81 	libutil/sha512.o\
     82 	libutil/sha512-224.o\
     83 	libutil/sha512-256.o\
     84 	libutil/strcasestr.o\
     85 	libutil/strlcat.o\
     86 	libutil/strlcpy.o\
     87 	libutil/strsep.o\
     88 	libutil/strnsubst.o\
     89 	libutil/strtonum.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 	make/make\
    135 	md5sum\
    136 	mkdir\
    137 	mkfifo\
    138 	mknod\
    139 	mktemp\
    140 	mv\
    141 	nice\
    142 	nl\
    143 	nohup\
    144 	od\
    145 	paste\
    146 	pathchk\
    147 	printenv\
    148 	printf\
    149 	pwd\
    150 	readlink\
    151 	renice\
    152 	rev\
    153 	rm\
    154 	rmdir\
    155 	sed\
    156 	seq\
    157 	setsid\
    158 	sha1sum\
    159 	sha224sum\
    160 	sha256sum\
    161 	sha384sum\
    162 	sha512sum\
    163 	sha512-224sum\
    164 	sha512-256sum\
    165 	sleep\
    166 	sort\
    167 	split\
    168 	sponge\
    169 	strings\
    170 	sync\
    171 	tail\
    172 	tar\
    173 	tee\
    174 	test\
    175 	tftp\
    176 	time\
    177 	touch\
    178 	tr\
    179 	true\
    180 	tsort\
    181 	tty\
    182 	uname\
    183 	unexpand\
    184 	uniq\
    185 	unlink\
    186 	uudecode\
    187 	uuencode\
    188 	wc\
    189 	which\
    190 	whoami\
    191 	xargs\
    192 	xinstall\
    193 	yes
    194 
    195 MAKEOBJ =\
    196 	make/defaults.o\
    197 	make/main.o\
    198 	make/parser.o\
    199 	make/posix.o\
    200 	make/rules.o\
    201 
    202 OBJ = $(LIBUTFOBJ) $(LIBUTILOBJ) $(MAKEOBJ)
    203 
    204 all: scripts/make
    205 	$(SMAKE) $(BIN)
    206 
    207 scripts/make:
    208 	$(CC) -o $@ make/*.c
    209 
    210 $(BIN): $(LIB)
    211 
    212 $(OBJ) $(BIN): $(HDR)
    213 
    214 .o:
    215 	$(CC) $(LDFLAGS) -o $@ $< $(LIB)
    216 
    217 .c.o:
    218 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
    219 
    220 .c:
    221 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LIB)
    222 
    223 $(MAKEOBJ): make/make.h
    224 
    225 make/make: $(MAKEOBJ)
    226 	$(CC) $(LDFLAGS) -o $@ $(MAKEOBJ) $(LIB)
    227 
    228 libutf.a: $(LIBUTFOBJ)
    229 	$(AR) $(ARFLAGS) $@ $?
    230 	$(RANLIB) $@
    231 
    232 libutil.a: $(LIBUTILOBJ)
    233 	$(AR) $(ARFLAGS) $@ $?
    234 	$(RANLIB) $@
    235 
    236 getconf: getconf.h
    237 
    238 getconf.h:
    239 	scripts/getconf.sh > $@
    240 
    241 proto: $(BIN)
    242 	scripts/mkproto $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
    243 
    244 install uninstall: proto
    245 	scripts/$@ proto
    246 
    247 sbase-box-install: sbase-box proto
    248 	scripts/install proto
    249 	$(DESTDIR)$(PREFIX)/bin/sbase-box -i $(DESTDIR)$(PREFIX)/bin/
    250 
    251 sbase-box-uninstall: sbase-box proto
    252 	$(DESTDIR)$(PREFIX)/bin/sbase-box -d $(DESTDIR)$(PREFIX)/bin/
    253 	scripts/uninstall proto
    254 
    255 dist: clean
    256 	mkdir -p sbase
    257 	cp -R LICENSE Makefile README TODO config.mk *.c *.1 *.h libutf libutil make sbase
    258 	mv sbase sbase-$(VERSION)
    259 	tar -cf sbase-$(VERSION).tar sbase-$(VERSION)
    260 	gzip sbase-$(VERSION).tar
    261 	rm -rf sbase-$(VERSION)
    262 
    263 sbase-box: $(BIN)
    264 	scripts/mkbox
    265 	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ build/*.c $(LIB)
    266 
    267 clean:
    268 	rm -f $(BIN) $(OBJ) $(LIB) sbase-box sbase-$(VERSION).tar.gz
    269 	rm -f scripts/make
    270 	rm -f getconf.h
    271 	rm -f proto
    272 	rm -rf build
    273 
    274 .PHONY: all install uninstall dist sbase-box-install sbase-box-uninstall clean