-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (35 loc) · 1.22 KB
/
Makefile
File metadata and controls
49 lines (35 loc) · 1.22 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
DESTBIN:= mingerd
build: $(DESTBIN)
include .depends
OBJS:= common.o main.o init.o sigevents.o config.o log.o emails.o digest.o
CC ?= gcc
CFLAGS ?= -O2 -Wall -pipe
LDFLAGS ?= -lbeecrypt
#CFLAGS:= -Wall -pipe -ggdb
VERSION:= 1.x
PREFIX:= $(HOME)
INSTALLBIN:= $(PREFIX)/bin
INSTALLDOC:= $(PREFIX)/doc
INSTALLETC:= $(PREFIX)/etc
.SUFFIXES: .c .o
$(DESTBIN): $(OBJS)
$(CC) $(CFLAGS) -o $(DESTBIN) $(OBJS) $(LDFLAGS)
install: build
@install -D -m 0755 --verbose -s $(DESTBIN) $(INSTALLBIN)/$(DESTBIN)
@install -D -m 0640 --verbose $(DESTBIN).conf $(INSTALLETC)/$(DESTBIN).conf
@install -D -m 0644 --verbose README $(INSTALLDOC)/$(DESTBIN)-$(VERSION)/README
@install -D -m 0644 --verbose COPYING $(INSTALLDOC)/$(DESTBIN)-$(VERSION)/COPYING
uninstall:
@rm -vf $(INSTALLBIN)/$(DESTBIN)
@mv -vf $(INSTALLETC)/$(DESTBIN).conf $(INSTALLETC)/$(DESTBIN).conf.save
@rm -vf $(INSTALLDOC)/$(DESTBIN)-$(VERSION)/{README,COPYING}
@rmdir -v $(INSTALLDOC)/$(DESTBIN)-$(VERSION)
dep\
.depends:
@echo "Rebuilding dependencies from sources ..."
@rm -f .depends
@if ls *.c &> /dev/null; then gcc -M *.c > .depends; else exit 0; fi
clean:
@rm -vf *~ $(OBJS)
distclean: clean
@rm -vf $(DESTBIN) .depends