-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
95 lines (64 loc) · 3.09 KB
/
Makefile
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
MAKEFILE = Makefile
PROGS = quipi send-udp-message capture-udp-port lock-n-run actor http-fetch svg-it
SOLOPROGS = iso8859-collapse extended-letters-collapse
SOBJS = parse_command_options.o cli_strerror.o allocate_plan_data.o get_destination_ip.o \
parse_destination_value.o convert_to_mode.o gsub_string.o get_groupname.o \
get_username.o switch_run_user.o switch_run_group.o int_to_str.o \
build_syscall_errmsg.o hexdigits_to_string.o xml2-util.o called_as_cgi.o \
get_cgi_data.o chunk_routines.o decode_url_str.o word_chain_routines.o \
is_option_set.o is_ipv4_address.o is_ipv6_address.o url_breakout_routines.o \
print_option_settings.o dup_memory.o get_scaled_number.o sys_call_fail_msg.o \
errmsg_with_string.o get_matching_interface.o is_reserved_uri_char.o \
parse_http_status.o construct_entry_form.o connect_host.o \
wait_until_sock_ready.o string-routines.o explode_string.o remove_empty_strings.o \
dup_value_chain.o free_value_chain.o free_chart_options.o
HTSOBJS = handle_ssl_error.o setup_ssl_env.o ssl_handshake.o stash_ssl_err_info.o \
verify_ssl_callback.o bio_ssl_callback.o calc_xfrates.o calc_standard_moments.o \
packet-svg-graphs.o alloc_chart_options.o ssl_init_routines.o s2n_write.o \
s2n_read.o s2n_finish.o verify_sni_callback.o
SVGOBJS = svg-routines.o packet-svg-graphs.o
LIBS = libCLISUB.a
UBIQ_H = err_ref.h net-task-data.h cli-sub.h
HTS_H = http-fetch.h
SVG_H = svg-tools.h
# ---
#DEBUG_DEFS = -DDEBUG_MALLOC
DEBUG_DEFS =
OS=$(shell uname)
LD_OPTS_Linux = -L/usr/lib/x86_64-linux-gnu -lrt
CFLAGS_Linux = -DUSE_CLOCK_GETTIME
CC = gcc $(DEBUG_DEFS) -Wall -g
LD = gcc
SSL_INC_CFLAGS =
SSL_LIB_LDFLAGS =
CFLAGS = -g -Wall -pedantic $(SSL_INC_CFLAGS) -I/usr/include/libxml2 $(CFLAGS_$(OS))
#CFLAGS = -g -Wall -pedantic -I/usr/include/libxml2 $(CFLAGS_$(OS)) -I/usr/local/src/debug
#CFLAGS = -g -Wall -pedantic -I/usr/include/libxml2 $(CFLAGS_$(OS)) -I/usr/local/src/debug -DDEBUG_MALLOC
LDFLAGS = $(SSL_LIB_LDFLAGS) -L . -lCLISUB -lxml2 -lm $(LD_OPTS_$(OS)) -lssl -lcrypto -ldl
#LDFLAGS = -L . -lCLISUB -lxml2 -lm $(LD_OPTS_$(OS)) -lssl -lcrypto /usr/local/src/debug/bug_malloc.o /usr/local/src/debug/dbg_hack_info.o /usr/local/src/trace/trace_table.o
ARCOMM = ar rlc
# ---
default:
@echo "You can make any of the following programs: $(PROGS) $(SOLOPROGS)"
# ---
.PHONY: all libs
all : $(PROGS) $(SOLOPROGS) $(LIBS)
libs : $(LIBS)
# ---
header-check.log: $(MAKEFILE) check-for-required-things
./check-for-required-things $@ "$(SSL_INC_CFLAGS)"
# ---
%.o : %.c $(MAKEFILE) header-check.log %.c $(UBIQ_H) %.h
$(CC) -c -o $@ $(CFLAGS) $<
$(SOBJS) : % : $(MAKEFILE) header-check.log $(UBIQ_H)
$(HTSOBJS) : % : $(MAKEFILE) header-check.log $(UBIQ_H) $(HTS_H)
$(SVGOBJS) : % : $(MAKEFILE) header-check.log $(UBIQ_H) $(SVG_H)
$(SOLOPROGS) : % : %.o $(MAKEFILE) header-check.log $(UBIQ_H) $(LIBS)
$(CC) -o $@ $(@).o $(LDFLAGS)
$(PROGS) : % : %.o %.h $(MAKEFILE) header-check.log $(UBIQ_H) $(LIBS)
$(CC) -o $@ $(@).o $(LDFLAGS)
libCLISUB.a : $(SOBJS) $(HTSOBJS) $(SVGOBJS)
$(ARCOMM) $@ $(SOBJS) $(HTSOBJS) $(SVGOBJS)
# ---
clean:
rm $(PROGS) $(SOLOPROGS) $(LIBS) *.o header-check.log