-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (27 loc) · 761 Bytes
/
Makefile
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
CC = gcc
CFLAGS = -std=c89 -pedantic -Wall
OBJS = groffhl.o
TARGET = groffhl
DESTDIR =
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
VERSION = 1.0
all: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(TARGET)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
debug: CFLAGS += -g -Og
debug: clean all
install: CFLAGS += -O3
install: clean all
@mkdir -p -- $(DESTDIR)$(PREFIX)/bin
cp -- $(TARGET) $(DESTDIR)$(PREFIX)/bin
@chmod 755 -- $(DESTDIR)$(PREFIX)/bin/$(TARGET)
@mkdir -p -- $(DESTDIR)$(MANPREFIX)/man1
sed "s/VERSION/$(VERSION)/g" < groffhl.1 > $(DESTDIR)$(MANPREFIX)/man1/groffhl.1
@chmod 644 -- $(DESTDIR)$(MANPREFIX)/man1/groffhl.1
uninstall:
rm -f -- $(DESTDIR)$(PREFIX)/bin/$(TARGET)
rm -f -- $(DESTDIR)$(MANPREFIX)/man1/groffhl.1
clean:
rm -f -- *.o