summaryrefslogtreecommitdiff
path: root/Makefile
blob: fb1fe46ceb1a92553621c416ddb044caf79375ac (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
33
VERSION = 0.1
PREFIX = /usr/local
CC = cc
CPPFLAGS = -D_DEFAULT_SOURCE
CFLAGS = --std=c99 -pedantic -Wall -Os
LDFLAGS  = -s -static

all: note

note: note.c

install: all
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	cp -f note $(DESTDIR)$(PREFIX)/bin
	chmod 755 $(DESTDIR)$(PREFIX)/bin/note

uninstall:
	rm -f $(DESTDIR)$(PREFIX)/bin/note

clean:
	rm -f note note-$(VERSION).tar.gz

dist: clean
	mkdir -p note-$(VERSION)
	cp -R TODO Makefile config.h note.c note-$(VERSION)
	tar -cf note-$(VERSION).tar note-$(VERSION)
	gzip note-$(VERSION).tar
	rm -rf note-$(VERSION)

.c:
	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<

.PHONY: all install uninstall clean dist