summaryrefslogtreecommitdiff
path: root/Makefile
blob: b81fa6563b70867448a41c180deb5d924296b93a (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
34
35
36
37
# limine-sync — boot menu generator for Limine
# https://rawnix.org

CC      ?= cc
CFLAGS  += -std=c99 -pedantic -Wall -Wextra -Os
LDFLAGS += -s

PREFIX  ?= /usr
SBINDIR  = /sbin
SYSCONFDIR = /etc
MANDIR   = $(PREFIX)/share/man

all: limine-sync

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

install: all
	install -Dm755 limine-sync $(DESTDIR)$(SBINDIR)/limine-sync
	install -Dm644 limine.conf.in $(DESTDIR)$(SYSCONFDIR)/limine.conf.in
	install -Dm644 limine-sync.conf.example \
		$(DESTDIR)$(SYSCONFDIR)/limine-sync.conf.example
	install -Dm644 limine-sync.8 $(DESTDIR)$(MANDIR)/man8/limine-sync.8

uninstall:
	rm -f $(DESTDIR)$(SBINDIR)/limine-sync
	rm -f $(DESTDIR)$(SYSCONFDIR)/limine.conf.in
	rm -f $(DESTDIR)$(SYSCONFDIR)/limine-sync.conf.example
	rm -f $(DESTDIR)$(MANDIR)/man8/limine-sync.8

lint:
	mandoc -Tlint limine-sync.8

clean:
	rm -f limine-sync

.PHONY: all install uninstall lint clean