-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.build
128 lines (84 loc) · 3 KB
/
Makefile.build
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
include defines.mk
include product.mk
CPPFLAGS =
CFLAGS = -O -g -Wall -Werror -Wfatal-errors
LDLIBS += -lm
ifdef E
LDLIBS += -static -lregex
endif
nroff ?= nroff
groff ?= groff
nroff_txt_flags ?= -c
groff_pdf_flags ?=
build_dir ?= build
ifndef top_dir
top_dir := ..
else
ifndef PWD
PWD := $(shell pwd)
endif
top_dir := $(shell realpath --relative-to '$(PWD)' '$(top_dir)')
endif
src_dir ?= $(top_dir)
inc_dir ?= $(top_dir)
vpath %.c $(src_dir)
vpath %.h $(inc_dir)
vpath % $(top_dir)
obj_targets = gw2dmk.o dmk2gw.o gw.o gwx.o msg.o m2.o gwhisto.o \
gwhist.o gwdetect.o crc.o
bins = gw2dmk dmk2gw gwhist
bin_targets = $(foreach b,$(bins), $b$E)
man_txt_targets = $(foreach b,$(bins),$b.1.txt)
man_pdf_targets = $(foreach b,$(bins),$b.1.pdf)
man_html_targets = $(foreach b,$(bins),$b.1.html)
man_targets = $(man_txt_targets) $(man_pdf_targets) $(man_html_targets)
targets = $(bin_targets) $(man_targets)
tar_files = LICENSE README.md $(targets) $(tar_extras)
clean_files = $(targets) $(obj_targets)
all: $(targets)
release: $(TARBALLGZ)
msg.o: msg.c msg.h
gw.o: misc.h msg_levels.h msg.h greaseweazle.h gw.h gw.c
gwx.o: misc.h msg_levels.h msg.h greaseweazle.h gw.h gwx.h gwx.c
gwhisto.o: misc.h msg_levels.h msg.h greaseweazle.h gw.h gwx.h \
gwhisto.h gwhisto.c
gwhist.o gw2dmk.o dmk2gw.o: CFLAGS += '-DVERSION="$(VERSION)"'
gwhist.o: gw.h gwx.h gwhisto.h msg_levels.h msg.h misc.h
gwdetect.o: misc.h msg_levels.h msg.h greaseweazle.h gw.h gwx.h gwmedia.h \
gwhisto.h gwfddrv.h gw2dmkcmdset.h gwdetect.h gwdetect.c
gwdecode.o: misc.h msg_levels.h msg.h greaseweazle.h gw.h gwx.h dmk.h \
gwmedia.h gwhisto.h gwdecode.h gwdecode.c
gwmedia.o: misc.h msg_levels.h msg.h greaseweazle.h gw.h gwx.h \
gwmedia.h gwhisto.h gwmedia.c
dmkmerge.o: msg.h dmk.h misc.h dmkmerge.h dmkmerge.c
dmk.o: dmk.h misc.h dmk.c
dmkx.o: dmk.h msg.h msg_levels.h misc.h dmkx.c
secsize.o: dmk.h misc.h secsize.c
gw2dmk.o: misc.h msg_levels.h msg.h greaseweazle.h gw.h gwx.h gwfddrv.h \
gw2dmkcmdset.h gwhisto.c dmk.h gw2dmk.c
dmk2gw.o: misc.h msg_levels.h msg.h greaseweazle.h gw.h gwx.h gwfddrv.h \
dmk2gwcmdset.h gwhisto.c dmk.h dmk2gw.c
gw2dmk$E: msg.o gw.o gwx.o gwhisto.o gwdetect.o gwdecode.o gwmedia.o dmk.o \
dmkmerge.o secsize.o gw2dmk.o crc.o
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o '$@'
dmk2gw$E: msg.o gw.o gwx.o gwdetect.o gwmedia.o dmk.o dmkx.o secsize.o dmk2gw.o
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o '$@'
gwhist$E: msg.o gw.o gwx.o gwhisto.o gwdetect.o gwhist.o
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o '$@'
m2$E: msg.o m2.o gw.o gwx.o
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o '$@'
%.txt: %
$(nroff) -man -Tascii $(nroff_txt_flags) $< | col -b | cat -s > $@
%.pdf: %
$(groff) -man -Tpdf $(groff_pdf_flags) $< > $@
%.html: %
$(groff) -man -Thtml $(groff_html_flags) $< > $@
$(TARBALLGZ): $(tar_files)
tar -czP \
--transform='s:^$(top_dir)/::' \
-f '$@' $^
clean clobber distclean:
$(call scrub_files_call,$($@_files))
.PHONY: FORCE all release
.PHONY: clean clobber distclean
.DELETE_ON_ERROR: