Mercurial > hg > th-libs
annotate Makefile.gen @ 587:98812eb78d8e
Add new compile-time optional th_optarg struct field o_arg for specifying the option argument description/name. TH_USE_OPT_ARG must be defined at compile time.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 12 Jan 2020 18:03:47 +0200 |
parents | a1dac9eb3f06 |
children | 3851e00bcd71 |
rev | line source |
---|---|
426
56874ab723d3
Fix build for older GCC versions.
Matti Hamalainen <ccr@tnsp.org>
parents:
419
diff
changeset
|
1 CFLAGS += -W -Wall -Wextra -D_XOPEN_SOURCE=500 -I./ |
564
a1dac9eb3f06
Typecast to void* to silence a silly clang-9 warning.
Matti Hamalainen <ccr@tnsp.org>
parents:
562
diff
changeset
|
2 CFLAGS += -std=c99 -pedantic |
406 | 3 CFLAGS += -g |
254
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 CFLAGS += -O2 |
426
56874ab723d3
Fix build for older GCC versions.
Matti Hamalainen <ccr@tnsp.org>
parents:
419
diff
changeset
|
5 CFLAGS += -DTH_USE_INTERNAL_SPRINTF=1 |
406 | 6 CFLAGS += -DTH_PRINTF_DEBUG=1 |
587
98812eb78d8e
Add new compile-time optional th_optarg struct field o_arg for specifying the option argument description/name. TH_USE_OPT_ARG must be defined at compile time.
Matti Hamalainen <ccr@tnsp.org>
parents:
564
diff
changeset
|
7 CFLAGS += -DTH_USE_OPT_ARG=1 |
426
56874ab723d3
Fix build for older GCC versions.
Matti Hamalainen <ccr@tnsp.org>
parents:
419
diff
changeset
|
8 |
406 | 9 THLIBS = ./ |
254
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 |
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
11 # |
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 # Objects |
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 # |
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 THLIBS_A=$(OBJPATH)thlibs.a |
273 | 15 THLIBS_OBJ=th_util.o th_config.o th_string.o th_ioctx.o \ |
476 | 16 th_args.o th_crypto.o th_datastruct.o th_network.o \ |
17 th_file.o | |
273 | 18 |
254
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 |
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
20 TESTS_OBJ=tests.o |
562
5d2c1bfc04aa
Rename EXEEXT to BINEXT in the build system.
Matti Hamalainen <ccr@tnsp.org>
parents:
476
diff
changeset
|
21 TESTS_BIN=$(BINPATH)tests$(BINEXT) |
254
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 |
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
23 TARGETS += $(TESTS_BIN) |
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 |
433 | 25 include $(THLIBS)/Makefile.inc |
26 | |
302 | 27 $(TESTS_BIN): $(addprefix $(OBJPATH),$(TESTS_OBJ)) $(THLIBS_A) |
474 | 28 $(LINK_BIN) |
254
3d1e2af4e4e6
Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 |
292 | 30 check: $(TESTS_BIN) |
31 $(TESTS_BIN) -v | |
32 |