blob: cba2c408c76a514e6d6daf332bf3497a5c3eb5ba [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 Lundbladecd532e42018-12-17 13:19:45 -080029CFLAGS=-I inc -I test -Os -Wall -Werror -pedantic-errors -Wextra -Wshadow -Wparentheses -xc -std=c99
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
Laurence Lundblade781fd822018-10-01 09:37:52 -070032
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080033TEST_OBJ=test/UsefulBuf_Tests.o test/qcbor_encode_tests.o test/qcbor_decode_tests.o test/run_tests.o \
Laurence Lundbladeb88b54a2018-12-18 18:06:22 -080034 test/float_tests.o test/half_to_double_from_rfc7049.o
Laurence Lundblade781fd822018-10-01 09:37:52 -070035
Laurence Lundblade2c978832018-12-13 01:10:21 -080036qcbortest: libqcbor.a $(TEST_OBJ) cmd_line_main.o
Laurence Lundbladecd532e42018-12-17 13:19:45 -080037 cc -o $@ $^ libqcbor.a
Laurence Lundblade74d265c2018-09-19 10:21:00 -070038
Laurence Lundbladecd532e42018-12-17 13:19:45 -080039qcbormin: libqcbor.a min_use_main.o
40 cc -dead_strip -o $@ $^ libqcbor.a
Laurence Lundblade74d265c2018-09-19 10:21:00 -070041
Laurence Lundbladec9d3dcf2018-12-19 18:11:36 -080042libqcbor.a: $(QCBOR_OBJ)
Laurence Lundblade2c978832018-12-13 01:10:21 -080043 ar -r $@ $^
Laurence Lundbladec2b14572018-11-01 13:07:49 +070044
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
49
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080050test/run_tests.o: test/UsefulBuf_Tests.h test/float_tests.h test/run_tests.h test/qcbor_encode_tests.h\
Laurence Lundbladeb88b54a2018-12-18 18:06:22 -080051 test/qcbor_decode_tests.h
Laurence Lundblade4d1ecba2018-10-12 21:22:30 +080052test/UsefulBuf_Tests.o: test/UsefulBuf_Tests.h inc/qcbor.h inc/UsefulBuf.h
53test/qcbor_encode_tests.o: test/qcbor_encode_tests.h inc/qcbor.h inc/UsefulBuf.h
54test/qcbor_decode_tests.o: test/qcbor_decode_tests.h inc/qcbor.h inc/UsefulBuf.h
55test/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 -070056test/half_to_double_from_rfc7049.o: test/half_to_double_from_rfc7049.h
57
Laurence Lundblade972e59c2018-11-11 15:57:23 +070058cmd_line_main.o: test/run_tests.h inc/qcbor.h
Laurence Lundblade74d265c2018-09-19 10:21:00 -070059
Laurence Lundbladec2b14572018-11-01 13:07:49 +070060min_use_main.o: inc/qcbor.h inc/UsefulBuf.h
61
Laurence Lundblade74d265c2018-09-19 10:21:00 -070062clean:
Laurence Lundbladeb26de6f2019-01-10 08:47:40 -080063 rm -f $(QCBOR_OBJ) $(TEST_OBJ) libqcbor.a min_use_main.o cmd_line_main.o