blob: 4af252170504242d846ccaa83e1da16de909ba3a [file] [log] [blame]
Laurence Lundbladec2b14572018-11-01 13:07:49 +07001# Copyright (c) 2018, Laurence Lundblade.
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met:
7# * Redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer.
9# * Redistributions in binary form must reproduce the above
10# copyright notice, this list of conditions and the following
11# disclaimer in the documentation and/or other materials provided
12# with the distribution.
13# * Neither the name of The Linux Foundation nor the names of its
14# contributors, nor the name "Laurence Lundblade" may be used to
15# endorse or promote products derived from this software without
16# specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
19# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
21# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
25# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
28# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30
Laurence Lundblade570fab52018-10-13 18:28:27 +080031CFLAGS=-I inc -I test -Os -Wall -Werror -pedantic-errors -Wextra -Wshadow
Laurence Lundblade74d265c2018-09-19 10:21:00 -070032
Laurence Lundbladec2b14572018-11-01 13:07:49 +070033QCBOR_OBJ=src/UsefulBuf.o src/qcbor_encode.o src/qcbor_decode.o src/ieee754.o
34QCBOR_OBJ2=$(QCBOR_OBJ) src/qcbor_decode_malloc.o
Laurence Lundblade781fd822018-10-01 09:37:52 -070035
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080036TEST_OBJ=test/UsefulBuf_Tests.o test/qcbor_encode_tests.o test/qcbor_decode_tests.o test/run_tests.o \
Laurence Lundblade471a3fd2018-10-18 21:27:45 +053037 test/float_tests.o test/half_to_double_from_rfc7049.o test/qcbor_decode_malloc_tests.o
Laurence Lundblade781fd822018-10-01 09:37:52 -070038
Laurence Lundbladec2b14572018-11-01 13:07:49 +070039CMD_LINE_OBJ=$(QCBOR_OBJ2) $(TEST_OBJ) cmd_line_main.o
Laurence Lundblade74d265c2018-09-19 10:21:00 -070040
41qcbortest: $(CMD_LINE_OBJ)
42 cc -o $@ $^ $(CFLAGS)
43
Laurence Lundbladec2b14572018-11-01 13:07:49 +070044qcbormin: $(QCBOR_OBJ) min_use_main.c
45 cc -dead_strip -o $@ $^ $(CFLAGS)
46
Laurence Lundblade74d265c2018-09-19 10:21:00 -070047src/UsefulBuf.o: inc/UsefulBuf.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070048src/qcbor_decode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h
49src/qcbor_encode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h
50src/iee754.o: src/ieee754.h
Laurence Lundblade471a3fd2018-10-18 21:27:45 +053051src/qcbor_malloc_decode.o: inc/qcbor.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070052
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080053test/run_tests.o: test/UsefulBuf_Tests.h test/float_tests.h test/run_tests.h test/qcbor_encode_tests.h\
Laurence Lundblade471a3fd2018-10-18 21:27:45 +053054 test/qcbor_decode_tests.h test/qcbor_decode_malloc_tests.h
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080055test/UsefulBuf_Tests.o: test/UsefulBuf_Tests.h inc/qcbor.h inc/UsefulBuf.h
56test/qcbor_encode_tests.o: test/qcbor_encode_tests.h inc/qcbor.h inc/UsefulBuf.h
57test/qcbor_decode_tests.o: test/qcbor_decode_tests.h inc/qcbor.h inc/UsefulBuf.h
58test/float_tests.o: inc/qcbor.h inc/UsefulBuf.h test/float_tests.h test/half_to_double_from_rfc7049.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070059test/half_to_double_from_rfc7049.o: test/half_to_double_from_rfc7049.h
Laurence Lundblade471a3fd2018-10-18 21:27:45 +053060test/qcbor_decode_malloc_test.o: test/qcbor_decode_malloc_tests.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070061
62cmd_line_main.o: test/run_tests.h
Laurence Lundblade74d265c2018-09-19 10:21:00 -070063
Laurence Lundbladec2b14572018-11-01 13:07:49 +070064min_use_main.o: inc/qcbor.h inc/UsefulBuf.h
65
Laurence Lundblade74d265c2018-09-19 10:21:00 -070066clean:
67 rm $(CMD_LINE_OBJ)