summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7ccebe126d125f1077c74e2ff8430885300748e8 (plain) (blame)
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
RM := rm -f

CFLAGS = \
	-D_FORTIFY_SOURCE=2    \
	-D_POSIX_SOURCE=199506 \
	-Iinclude              \
	-O3                    \
	-Wall                  \
	-Wextra                \
	-Wformat=2             \
	-Wmissing-declarations \
	-Wmissing-include-dirs \
	-Wnull-dereference     \
	-Wpedantic             \
	-Wpointer-arith        \
	-Wstrict-overflow=5    \
	-g                     \
	-o$(@)                 \
	-std=c99

OBJS := \
	source/checkParams.o \
	source/copyright.o   \
	source/exit.o        \
	source/getSum.o      \
	source/help.o        \
	source/initData.o    \
	source/main.o        \
	source/open.o        \
	source/patch.o       \
	source/read.o

BIN := agbsum

$(BIN): $(OBJS)
	$(CC) -o$(BIN) $(OBJS)

$(OBJS): include/agbsum.h

.PHONY: clean install purge

clean:
	$(RM) $(OBJS)

purge: clean
	$(RM) $(BIN)

install: $(BIN)
	mkdir -pm755 "$(BINDIR)"
	install -m755 "agbsum" "$(BINDIR)"