blob: 62d7c5ccdd612296788cd4ad2a74d03850d03bf8 [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 Lundblade2c978832018-12-13 01:10:21 -080037qcbortest: libqcbor.a $(TEST_OBJ) cmd_line_main.o
38 cc -o $@ $^ $(CFLAGS) libqcbor.a
Laurence Lundblade74d265c2018-09-19 10:21:00 -070039
Laurence Lundblade2c978832018-12-13 01:10:21 -080040qcbormin: libqcbor.a min_use_main.c
41 cc -dead_strip -o $@ $^ $(CFLAGS) libqcbor.a
Laurence Lundblade74d265c2018-09-19 10:21:00 -070042
Laurence Lundblade2c978832018-12-13 01:10:21 -080043libqcbor.a: $(QCBOR_OBJ2)
44 ar -r $@ $^
Laurence Lundbladec2b14572018-11-01 13:07:49 +070045
Laurence Lundblade74d265c2018-09-19 10:21:00 -070046src/UsefulBuf.o: inc/UsefulBuf.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070047src/qcbor_decode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h
48src/qcbor_encode.o: inc/UsefulBuf.h inc/qcbor.h src/ieee754.h
49src/iee754.o: src/ieee754.h
Laurence Lundblade471a3fd2018-10-18 21:27:45 +053050src/qcbor_malloc_decode.o: inc/qcbor.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070051
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080052test/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 +053053 test/qcbor_decode_tests.h test/qcbor_decode_malloc_tests.h
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080054test/UsefulBuf_Tests.o: test/UsefulBuf_Tests.h inc/qcbor.h inc/UsefulBuf.h
55test/qcbor_encode_tests.o: test/qcbor_encode_tests.h inc/qcbor.h inc/UsefulBuf.h
56test/qcbor_decode_tests.o: test/qcbor_decode_tests.h inc/qcbor.h inc/UsefulBuf.h
57test/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 -070058test/half_to_double_from_rfc7049.o: test/half_to_double_from_rfc7049.h
Laurence Lundblade471a3fd2018-10-18 21:27:45 +053059test/qcbor_decode_malloc_test.o: test/qcbor_decode_malloc_tests.h
Laurence Lundblade781fd822018-10-01 09:37:52 -070060
Laurence Lundblade972e59c2018-11-11 15:57:23 +070061cmd_line_main.o: test/run_tests.h inc/qcbor.h
Laurence Lundblade74d265c2018-09-19 10:21:00 -070062
Laurence Lundbladec2b14572018-11-01 13:07:49 +070063min_use_main.o: inc/qcbor.h inc/UsefulBuf.h
64
Laurence Lundblade74d265c2018-09-19 10:21:00 -070065clean:
Laurence Lundblade2c978832018-12-13 01:10:21 -080066 rm -f $(QCBOR_OBJ2) $(TEST_OBJ) libqcbor.a