File: Makefile

package info (click to toggle)
libargs 6.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 956 kB
  • sloc: cpp: 10,576; makefile: 56; sh: 19; python: 12
file content (61 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download
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
OS = $(shell uname -s)

CC 			?= 	cc
CXX			?= 	c++
DESTDIR		?= 	/usr/local
FLAGS 		+= 	-std=c++11
ifdef DEBUG
FLAGS		+=	-ggdb -O0
else
FLAGS		+=	-O0
endif

LIBS 		= 	
CFLAGS		+=	-I. $(FLAGS) -c -MMD -Wall -Wextra -Wno-unused-parameter -Werror -pedantic
LDFLAGS		+=	$(FLAGS)

SOURCES		= 	test.cxx
OBJECTS		= 	$(SOURCES:.cxx=.o)
DEPENDENCIES=	$(SOURCES:.cxx=.d)
EXECUTABLE	=	argstest

.PHONY: all clean pages runtests uninstall install installman

all: $(EXECUTABLE)

-include $(DEPENDENCIES)

$(EXECUTABLE): $(OBJECTS)
	$(CXX) -o $@ $(OBJECTS) $(LDFLAGS)

uninstall:
	-rm $(DESTDIR)/include/args.hxx
	-rmdir $(DESTDIR)/include
	-rm $(DESTDIR)/share/man/man3/args_*.3.bz2
	-rmdir -p $(DESTDIR)/share/man/man3

install:
	mkdir -p $(DESTDIR)/include
	cp args.hxx $(DESTDIR)/include

installman: doc/man
	mkdir -p $(DESTDIR)/share/man/man3
	cp doc/man/man3/*.3.bz2 $(DESTDIR)/share/man/man3

clean:
	rm -rfv $(EXECUTABLE) $(OBJECTS) $(DEPENDENCIES) doc

pages:
	-rm -r pages/*
	doxygen Doxyfile
	cp -rv doc/html/* pages/

doc/man: 
	doxygen Doxyfile
	bzip2 doc/man/man3/*.3

runtests: ${EXECUTABLE}
	./${EXECUTABLE}

%.o: %.cxx
	$(CXX) $< -o $@ $(CFLAGS)