File: Makefile

package info (click to toggle)
bcal 2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 228 kB
  • sloc: ansic: 1,837; python: 170; makefile: 43; sh: 5
file content (53 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download | duplicates (2)
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
PREFIX ?= /usr/local
BINDIR = $(DESTDIR)$(PREFIX)/bin
MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1
DOCDIR = $(DESTDIR)$(PREFIX)/share/doc/bcal
STRIP ?= strip

CFLAGS_OPTIMIZATION ?= -O3
CFLAGS_WARNINGS     ?= -Wall -Wextra -Wno-unused-parameter -Werror

LDLIBS_READLINE ?= -lreadline

CFLAGS += $(CFLAGS_OPTIMIZATION) $(CFLAGS_WARNINGS)
LDLIBS += $(LDLIBS_READLINE)

SRC = $(wildcard src/*.c)
INCLUDE = -Iinc

bcal: $(SRC)
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o bcal $(SRC) $(LDLIBS)

all: bcal

x86: $(SRC)
	$(CC) -m64 $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o bcal $(SRC) $(LDLIBS)
	strip bcal

distclean: clean
	rm -f *~

install: bcal
	install -m 0755 -d $(BINDIR)
	install -m 0755 -d $(MANDIR)
	install -m 0755 -d $(DOCDIR)
	install -m 0755 bcal $(BINDIR)
	gzip -c bcal.1 > bcal.1.gz
	install -m 0644 bcal.1.gz $(MANDIR)
	install -m 0644 README.md $(DOCDIR)
	rm -f bcal.1.gz

uninstall:
	rm -f $(BINDIR)/bcal
	rm -f $(MANDIR)/bcal.1.gz
	rm -rf $(DOCDIR)

strip: bcal
	$(STRIP) $^

clean:
	-rm -f bcal

skip: ;

.PHONY: bcal all x86 distclean install uninstall strip clean