summaryrefslogtreecommitdiff
path: root/Makefile
blob: e1ee228f6eb4940a3352dcf453517251fc449daf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

bindir = /bin
usrbindir = /usr/bin

CFLAGS = -D_XOPEN_SOURCE=700 -Os -Wall -Wno-format -Wno-char-subscripts -Wno-unused -Wno-parentheses
LDFLAGS = 

-include config.mak

B = cat true false pwd grep
UB = strings basename dirname link wc fold iconv

ALL = $(B:%=bin/%) $(UB:%=bin/%)

all: $(ALL)

clean:
	rm -f $(ALL)

bin/%: src/%.c
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<

install: $(patsubst bin/%,$(bindir)/%,$(B)) $(patsubst bin/%,$(usrbindir)/%,$(UB))

size: $(ALL)
	size -t $(ALL)

$(bindir)/%: bin/%
	install $< $(bindir)

$(usrbindir)/%: bin/%
	install $< $(usrbindir)