Laurence Lundblade | 01168ef | 2019-01-21 17:05:47 -0800 | [diff] [blame] | 1 | # 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 Lundblade | df1c1cf | 2019-01-17 11:55:05 -0800 | [diff] [blame] | 4 | # |
Laurence Lundblade | 01168ef | 2019-01-21 17:05:47 -0800 | [diff] [blame] | 5 | # SPDX-License-Identifier: BSD-3-Clause |
Laurence Lundblade | df1c1cf | 2019-01-17 11:55:05 -0800 | [diff] [blame] | 6 | # |
Laurence Lundblade | 01168ef | 2019-01-21 17:05:47 -0800 | [diff] [blame] | 7 | # See BSD-3-Clause license in README.md |
| 8 | # |
Laurence Lundblade | 5e39082 | 2019-01-06 12:35:01 -0800 | [diff] [blame] | 9 | |
Laurence Lundblade | ea627d2 | 2020-01-24 14:03:37 -0800 | [diff] [blame] | 10 | CFLAGS=-I inc -I test -Os -Wcast-align -Wall -Werror -pedantic-errors -Wextra -Wshadow -Wparentheses -xc -std=c99 -Werror=maybe-uninitialized |
| 11 | CC=/usr/local/bin/gcc-9 |
Laurence Lundblade | 5e39082 | 2019-01-06 12:35:01 -0800 | [diff] [blame] | 12 | |
Laurence Lundblade | df1c1cf | 2019-01-17 11:55:05 -0800 | [diff] [blame] | 13 | QCBOR_OBJ=src/UsefulBuf.o src/qcbor_encode.o src/qcbor_decode.o src/ieee754.o |
Laurence Lundblade | 5e39082 | 2019-01-06 12:35:01 -0800 | [diff] [blame] | 14 | |
| 15 | TEST_OBJ=test/UsefulBuf_Tests.o test/qcbor_encode_tests.o test/qcbor_decode_tests.o test/run_tests.o \ |
Laurence Lundblade | df1c1cf | 2019-01-17 11:55:05 -0800 | [diff] [blame] | 16 | test/float_tests.o test/half_to_double_from_rfc7049.o |
Laurence Lundblade | 5e39082 | 2019-01-06 12:35:01 -0800 | [diff] [blame] | 17 | |
| 18 | qcbortest: libqcbor.a $(TEST_OBJ) cmd_line_main.o |
| 19 | $(CC) -o $@ $^ libqcbor.a |
| 20 | |
| 21 | qcbormin: libqcbor.a min_use_main.o |
| 22 | $(CC) -dead_strip -o $@ $^ libqcbor.a |
| 23 | |
| 24 | libqcbor.a: $(QCBOR_OBJ) |
| 25 | ar -r $@ $^ |
| 26 | |
| 27 | src/UsefulBuf.o: inc/UsefulBuf.h |
| 28 | src/qcbor_decode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h |
| 29 | src/qcbor_encode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h |
Laurence Lundblade | df1c1cf | 2019-01-17 11:55:05 -0800 | [diff] [blame] | 30 | src/iee754.o: src/ieee754.h |
Laurence Lundblade | 5e39082 | 2019-01-06 12:35:01 -0800 | [diff] [blame] | 31 | |
| 32 | test/run_tests.o: test/UsefulBuf_Tests.h test/float_tests.h test/run_tests.h test/qcbor_encode_tests.h\ |
Laurence Lundblade | df1c1cf | 2019-01-17 11:55:05 -0800 | [diff] [blame] | 33 | test/qcbor_decode_tests.h |
Laurence Lundblade | 5e39082 | 2019-01-06 12:35:01 -0800 | [diff] [blame] | 34 | test/UsefulBuf_Tests.o: test/UsefulBuf_Tests.h inc/qcbor.h inc/UsefulBuf.h |
| 35 | test/qcbor_encode_tests.o: test/qcbor_encode_tests.h inc/qcbor.h inc/UsefulBuf.h |
| 36 | test/qcbor_decode_tests.o: test/qcbor_decode_tests.h inc/qcbor.h inc/UsefulBuf.h |
| 37 | test/float_tests.o: inc/qcbor.h inc/UsefulBuf.h test/float_tests.h test/half_to_double_from_rfc7049.h |
| 38 | test/half_to_double_from_rfc7049.o: test/half_to_double_from_rfc7049.h |
| 39 | |
| 40 | cmd_line_main.o: test/run_tests.h inc/qcbor.h |
| 41 | |
| 42 | min_use_main.o: inc/qcbor.h inc/UsefulBuf.h |
| 43 | |
| 44 | clean: |
Laurence Lundblade | b26de6f | 2019-01-10 08:47:40 -0800 | [diff] [blame] | 45 | rm -f $(QCBOR_OBJ) $(TEST_OBJ) libqcbor.a min_use_main.o cmd_line_main.o |