-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (48 loc) · 1.24 KB
/
Makefile
File metadata and controls
61 lines (48 loc) · 1.24 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
CC ?= cc
CFLAGS += -D_POSIX_C_SOURCE=199309L -std=c99 -Wall -Wextra
LDFLAGS += -lm
TARGET = diskgraph
MANPAGE = $(TARGET).1
SRC = diskgraph.c
OBJ = $(SRC:.c=.o)
# Installation paths
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
# Distribution files
DISTFILES = \
Makefile \
$(SRC) \
$(MANPAGE) \
README.md \
LICENSE \
images \
debian
# Version for Debian packaging
VERSION = 1.2
DEB_RELEASE = 1
PPA = ppa:b-stolk/ppa
.PHONY: all clean install uninstall tarball packageupload
all: $(TARGET)
$(TARGET): $(OBJ)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJ) $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJ) $(TARGET)
@echo All clean
install: $(TARGET)
install -d $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(MANDIR)
install -m 755 $(TARGET) $(DESTDIR)$(BINDIR)/
install -m 644 $(MANPAGE) $(DESTDIR)$(MANDIR)/
uninstall:
rm -f $(DESTDIR)$(BINDIR)/$(TARGET)
rm -f $(DESTDIR)$(MANDIR)/$(MANPAGE)
tarball:
@echo Creating tarball in parent directory (required for Debian packaging)...
tar cvzf ../$(TARGET)_$(VERSION).orig.tar.gz $(DISTFILES)
packageupload:
debuild -S
debsign ../$(TARGET)_$(VERSION)-$(DEB_RELEASE)_source.changes
dput --force $(PPA) ../$(TARGET)_$(VERSION)-$(DEB_RELEASE)_source.changes