blob: 15a2c1753ac4ab5364d9c3978f24bc104550aaa9 [file] [log] [blame]
Laurence Lundblade0dbc9172018-11-01 14:17:21 +07001# Copyright (c) 2018, Laurence Lundblade.
2# All rights reserved.
3#
Laurence Lundbladec2b14572018-11-01 13:07:49 +07004# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met:
Laurence Lundblade0dbc9172018-11-01 14:17:21 +07007# * 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# * The name "Laurence Lundblade" may not be used to
14# endorse or promote products derived from this software without
15# specific prior written permission.
16#
Laurence Lundbladec2b14572018-11-01 13:07:49 +070017# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
Laurence Lundblade0dbc9172018-11-01 14:17:21 +070027# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Laurence Lundbladec2b14572018-11-01 13:07:49 +070028
Laurence Lundblade570fab52018-10-13 18:28:27 +080029CFLAGS=-I inc -I test -Os -Wall -Werror -pedantic-errors -Wextra -Wshadow
Laurence Lundblade74d265c2018-09-19 10:21:00 -070030
Laurence Lundbladec2b14572018-11-01 13:07:49 +070031QCBOR_OBJ=src/UsefulBuf.o src/qcbor_encode.o src/qcbor_decode.o src/ieee754.o
32QCBOR_OBJ2=$(QCBOR_OBJ) src/qcbor_decode_malloc.o
Laurence Lundblade781fd822018-10-01 09:37:52 -070033
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080034TEST_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 +053035 test/float_tests.o test/half_to_double_from_rfc7049.o test/qcbor_decode_malloc_tests.o
Laurence Lundblade781fd822018-10-01 09:37:52 -070036
Laurence Lundbladec2b14572018-11-01 13:07:49 +070037CMD_LINE_OBJ=$(QCBOR_OBJ2) $(TEST_OBJ) cmd_line_main.o
Laurence Lundblade74d265c2018-09-19 10:21:00 -070038
39qcbortest: $(CMD_LINE_OBJ)
40 cc -o $@ $^ $(CFLAGS)
41
Laurence Lundbladec2b14572018-11-01 13:07:49 +070042qcbormin: $(QCBOR_OBJ) min_use_main.c
43 cc -dead_strip -o $@ $^ $(CFLAGS)
44
Laurence Lundblade74d265c2018-09-19 10:21:00 -070045src/UsefulBuf.o: inc/UsefulBuf.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070046src/qcbor_decode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h
47src/qcbor_encode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h
48src/iee754.o: src/ieee754.h
Laurence Lundblade471a3fd2018-10-18 21:27:45 +053049src/qcbor_malloc_decode.o: inc/qcbor.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070050
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080051test/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 +053052 test/qcbor_decode_tests.h test/qcbor_decode_malloc_tests.h
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080053test/UsefulBuf_Tests.o: test/UsefulBuf_Tests.h inc/qcbor.h inc/UsefulBuf.h
54test/qcbor_encode_tests.o: test/qcbor_encode_tests.h inc/qcbor.h inc/UsefulBuf.h
55test/qcbor_decode_tests.o: test/qcbor_decode_tests.h inc/qcbor.h inc/UsefulBuf.h
56test/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 -070057test/half_to_double_from_rfc7049.o: test/half_to_double_from_rfc7049.h
Laurence Lundblade471a3fd2018-10-18 21:27:45 +053058test/qcbor_decode_malloc_test.o: test/qcbor_decode_malloc_tests.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070059
Laurence Lundblade972e59c2018-11-11 15:57:23 +070060cmd_line_main.o: test/run_tests.h inc/qcbor.h
Laurence Lundblade74d265c2018-09-19 10:21:00 -070061
Laurence Lundbladec2b14572018-11-01 13:07:49 +070062min_use_main.o: inc/qcbor.h inc/UsefulBuf.h
63
Laurence Lundblade74d265c2018-09-19 10:21:00 -070064clean:
65 rm $(CMD_LINE_OBJ)