File: Makefile

package info (click to toggle)
nodau 0.3.8-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 176 kB
  • ctags: 88
  • sloc: ansic: 1,153; makefile: 47
file content (61 lines) | stat: -rw-r--r-- 1,422 bytes parent folder | download | duplicates (3)
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 ?= gcc

PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man/man1

SRCDIR=src
INCDIR=inc

TARGET=nodau
VERSION=0.3.8

NODAU_CFLAGS ?= -Wall -g -pedantic -DTARGET=\"$(TARGET)\" -DVERSION=\"$(VERSION)\" -Iinc/ -I. $(CFLAGS)
NODAU_CPPFLAGS ?= $(CPPFLAGS)
NODAU_CLIBS ?= -lsqlite3 -lncurses -lcrypto $(CLIBS)
NODAU_LDFLAGS ?= $(LDFLAGS)

OBJS=$(SRCDIR)/nodau.o $(SRCDIR)/db.o $(SRCDIR)/lib.o $(SRCDIR)/edit.o $(SRCDIR)/crypto.o $(SRCDIR)/config.o
DISTFILES=man $(SRCDIR) $(INCDIR) config.h Makefile* CHANGELOG LICENSE README

all: default

default: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(NODAU_LDFLAGS) -o $(TARGET) $(OBJS) $(NODAU_CLIBS)

dist-base:
	mkdir -p $(TARGET)-$(VERSION)
	cp -Rt $(TARGET)-$(VERSION) $(DISTFILES)

dist-gz: dist-base
	tar czf $(TARGET)-$(VERSION).tar.gz $(TARGET)-$(VERSION)
	rm -r $(TARGET)-$(VERSION)

dist-bz2: dist-base
	tar cjf $(TARGET)-$(VERSION).tar.bz2 $(TARGET)-$(VERSION)
	rm -r $(TARGET)-$(VERSION)

dist: dist-bz2

distclean:
	rm -f $(OBJS)

clean: distclean
	rm -f $(TARGET)*

install: $(TARGET)
	install $(TARGET) $(BINDIR)/$(TARGET)
	-install man/$(TARGET).1 $(MANDIR)/$(TARGET).1

uninstall:
	rm -f $(BINDIR)/$(TARGET)
	rm -f $(MANDIR)/$(TARGET).1

fresh: clean all

$(SRCDIR)/%.o: $(SRCDIR)/%.c inc/nodau.h config.h
	$(CC) $(NODAU_CPPFLAGS) $(NODAU_CFLAGS) -o $@ -c $<

.PHONY: all default distclean dist dist-base dist-bz2 dist-gz clean fresh install uninstall