blob: 38cfb789d33d6bb4b93fd61411b6ed158103a3b5 [file] [log] [blame]
Laurence Lundblade01168ef2019-01-21 17:05:47 -08001# Makefile -- UNIX-style make for qcbor as a lib and command line test
2#
3# Copyright (c) 2018-2019, Laurence Lundblade. All rights reserved.
Laurence Lundbladedf1c1cf2019-01-17 11:55:05 -08004#
Laurence Lundblade01168ef2019-01-21 17:05:47 -08005# SPDX-License-Identifier: BSD-3-Clause
Laurence Lundbladedf1c1cf2019-01-17 11:55:05 -08006#
Laurence Lundblade01168ef2019-01-21 17:05:47 -08007# See BSD-3-Clause license in README.md
8#
Laurence Lundblade5e390822019-01-06 12:35:01 -08009
Laurence Lundbladeea627d22020-01-24 14:03:37 -080010CFLAGS=-I inc -I test -Os -Wcast-align -Wall -Werror -pedantic-errors -Wextra -Wshadow -Wparentheses -xc -std=c99 -Werror=maybe-uninitialized
11CC=/usr/local/bin/gcc-9
Laurence Lundblade5e390822019-01-06 12:35:01 -080012
Laurence Lundbladedf1c1cf2019-01-17 11:55:05 -080013QCBOR_OBJ=src/UsefulBuf.o src/qcbor_encode.o src/qcbor_decode.o src/ieee754.o
Laurence Lundblade5e390822019-01-06 12:35:01 -080014
15TEST_OBJ=test/UsefulBuf_Tests.o test/qcbor_encode_tests.o test/qcbor_decode_tests.o test/run_tests.o \
Laurence Lundbladedf1c1cf2019-01-17 11:55:05 -080016 test/float_tests.o test/half_to_double_from_rfc7049.o
Laurence Lundblade5e390822019-01-06 12:35:01 -080017
18qcbortest: libqcbor.a $(TEST_OBJ) cmd_line_main.o
19 $(CC) -o $@ $^ libqcbor.a
20
21qcbormin: libqcbor.a min_use_main.o
22 $(CC) -dead_strip -o $@ $^ libqcbor.a
23
24libqcbor.a: $(QCBOR_OBJ)
25 ar -r $@ $^
26
27src/UsefulBuf.o: inc/UsefulBuf.h
28src/qcbor_decode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h
29src/qcbor_encode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h
Laurence Lundbladedf1c1cf2019-01-17 11:55:05 -080030src/iee754.o: src/ieee754.h
Laurence Lundblade5e390822019-01-06 12:35:01 -080031
32test/run_tests.o: test/UsefulBuf_Tests.h test/float_tests.h test/run_tests.h test/qcbor_encode_tests.h\
Laurence Lundbladedf1c1cf2019-01-17 11:55:05 -080033 test/qcbor_decode_tests.h
Laurence Lundblade5e390822019-01-06 12:35:01 -080034test/UsefulBuf_Tests.o: test/UsefulBuf_Tests.h inc/qcbor.h inc/UsefulBuf.h
35test/qcbor_encode_tests.o: test/qcbor_encode_tests.h inc/qcbor.h inc/UsefulBuf.h
36test/qcbor_decode_tests.o: test/qcbor_decode_tests.h inc/qcbor.h inc/UsefulBuf.h
37test/float_tests.o: inc/qcbor.h inc/UsefulBuf.h test/float_tests.h test/half_to_double_from_rfc7049.h
38test/half_to_double_from_rfc7049.o: test/half_to_double_from_rfc7049.h
39
40cmd_line_main.o: test/run_tests.h inc/qcbor.h
41
42min_use_main.o: inc/qcbor.h inc/UsefulBuf.h
43
44clean:
Laurence Lundbladeb26de6f2019-01-10 08:47:40 -080045 rm -f $(QCBOR_OBJ) $(TEST_OBJ) libqcbor.a min_use_main.o cmd_line_main.o