summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..259f782
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+
+bindir = /bin
+usrbindir = /usr/bin
+
+CFLAGS = -D_XOPEN_SOURCE=700 -Os -s -Wall -Wno-format -Wno-char-subscripts -Wno-unused -Wno-parentheses
+LDFLAGS = -s
+
+-include config.mak
+
+B = cat true false pwd
+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)