aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 5048a28eb8a2650c89da09f9e700acaa8148add4 (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
include config.mk

SRC = donut.c
OBJ = ${SRC:.c=.o}

all: options donut

options:
	@echo donut build options:
	@echo "CFLAGS = ${CFLAGS}"
	@echo "LDFLAGS = ${LDFLAGS}"
	@echo "CC = ${CC}"

.c.o:
	${CC} -c ${CFLAGS} $<

${OBJ}: config.h config.mk

config.h:
	cp config.def.h $@

donut: ${OBJ}
	${CC} -o $@ ${OBJ} ${LDFLAGS}

clean:
	rm -f donut ${OBJ}

install: all
	mkdir -p ${DESTDIR}${PREFIX}/bin
	cp -f donut ${DESTDIR}${PREFIX}/bin
	chmod 755 ${DESTDIR}${PREFIX}/bin/donut

uninstall:
	rm -f ${DESTDIR}${PREFIX}/bin/donut

.PHONY: all options clean install uninstall