Makefile

Wed, 25 Mar 2020 17:03:18 +0100

author
David Demelier <markand@malikania.fr>
date
Wed, 25 Mar 2020 17:03:18 +0100
changeset 12
083f11d2536f
parent 11
43a9d763656b
child 13
5c917a8cd011
permissions
-rw-r--r--

misc: various issues

#
# Makefile -- basic Makefile for libunicode
#
# Copyright (c) 2013-2020 David Demelier <markand@malikania.fr>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

.POSIX:

CC=     cc
CPP=    c++
CFLAGS= -O3 -DNDEBUG

.SUFFIXES:
.SUFFIXES: .c .cpp

all: unicode.cpp unicode.c

.c:
	${CC} ${CFLAGS} -Iextern/libgreatest -I. $< unicode.c -o $@ ${LDFLAGS}

.cpp:
	${CPP} ${CFLAGS} -Iextern/libgreatest -I. $< unicode.cpp -o $@ ${LDFLAGS}

gen/mkunicode-c: gen/src/mkunicode-c.c
	${CC} ${CFLAGS} -o $@ gen/src/mkunicode-c.c ${LDFLAGS}

gen/mkunicode-cpp: gen/src/mkunicode-cpp.c
	${CC} ${CFLAGS} -o $@ gen/src/mkunicode-cpp.c ${LDFLAGS}

unicode.c: gen/mkunicode-c gen/unicode-before.c gen/unicode-after.c
	cat gen/unicode-before.c > unicode.c
	gen/mkunicode-c unicode.c gen/UnicodeData.txt
	cat gen/unicode-after.c >> unicode.c

unicode.cpp: gen/mkunicode-cpp gen/unicode-before.cpp gen/unicode-after.cpp
	cat gen/unicode-before.cpp > unicode.cpp
	gen/mkunicode-cpp unicode.cpp gen/UnicodeData.txt
	cat gen/unicode-after.cpp >> unicode.cpp

tests: test/unicode test/unicode++
	test/unicode

doxygen:
	doxygen Doxyfile

clean:
	rm -f gen/mkunicode-c gen/mkunicode-cpp
	rm -f test/unicode test/unicode++

.PHONY: all clean doxygen tests

mercurial