view Makefile @ 29:daeb2f6e6b22

base64: use more idiomatic comparison
author David Demelier <markand@malikania.fr>
date Mon, 17 May 2021 13:43:17 +0200
parents 3172e43c9b43
children 16f64f665b1d
line wrap: on
line source

#
# Makefile -- basic Makefile for libbase64
#
# 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
CXX=            c++
CFLAGS=         -O3 -DNDEBUG
CXXFLAGS=       -std=c++17 -O3 -DNDEBUG

.SUFFIXES:
.SUFFIXES: .c .cpp .o

all:

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

.cpp.o:
	${CXX} ${CXXFLAGS} -Iextern/libgreatest -I. -c $< -o $@ ${LDFLAGS}

test/base64.o: base64.h

test/base64: test/base64.o base64.o
	${CC} -o $@ test/base64.o base64.o ${LDFLAGS}

test/base64++.o: base64.hpp

test/base64++: test/base64++.o
	${CXX} -o $@ test/base64++.o ${LDFLAGS}

tests: test/base64 test/base64++
	test/base64
	test/base64++

doxygen:
	doxygen Doxyfile

clean:
	rm -f *.o test/*.o
	rm -f test/base64 test/base64++

.PHONY: all clean doxygen tests