-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
86 lines (68 loc) · 1.94 KB
/
makefile
File metadata and controls
86 lines (68 loc) · 1.94 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#===---------------------------------------------*- makefile -*---===
#: sysconf
# This file was automatically generated
#===--------------------------------------------------------------===
sysconf : HEADERS = \
src/parse-config.h \
src/print-config.h \
src/abort.h
sysconf : SOURCES = \
src/print-config.c \
src/parse-config.c \
src/abort.c \
src/sysconf.c
TEST_HEADERS = \
test/minunit.h
TEST_SOURCES = \
src/print-config.c \
src/parse-config.c \
src/abort.c \
test/test_sysconf.c
#--------------------------------------------------------------------
# Set the project directories and build parameters.
#--------------------------------------------------------------------
SRCDIR = src
DOCDIR = doc
PREFIX := /usr/local/bin
MANPATH := /usr/local/share/man/man7
CC := cc
#-X- CFLAGS := -fno-exceptions -pipe -Wall -W -g -fsanitize=address
CFLAGS := -fno-exceptions -pipe -Wall -W
INCPATH = -I $(SRCDIR) -I $(SRCDIR)
REMOVE := rm -f
CP := cp
CTAGS := ctags
OBJECTS = $(SOURCES:.c=.o)
#--------------------------------------------------------------------
# Define the target compile instructions.
#--------------------------------------------------------------------
# By listing the header files as a dependency as well, it ensures that
# if a change was made to a header file then the entire program will
# be rebuilt.
sysconf: $(HEADERS) ctags cleanobjs
SYSCONF_TARGET='sysconf'
@$(CC) $(CFLAGS) $(INCPATH) -o sysconf $(SOURCES)
.PHONY: test
test: $(HEADERS) $(TEST_HEADERS)
TEST='test_sysconf'
@$(CC) $(CFLAGS) -I test $(INCPATH) -o test_sysconf $(TEST_SOURCES)
.PHONY: clean
clean:
@$(REMOVE) sysconf $(OBJECTS)
.PHONY: ctags
ctags:
@$(CTAGS) $(SOURCES) .
.PHONY: cleanobjs
cleanobjs:
@$(REMOVE) $(OBJECTS)
.PHONY: install
install:
@$(CP) sysconf $(PREFIX)/sysconf
@$(CP) ./doc/sysconf.7 $(MANPATH)
.PHONY: uninstall
uninstall:
$(RM) $(PREFIX)/sysconf
$(RM) $(MANPATH)/sysconf.7
.PHONY: all
all: sysconf
# vim: set noet