1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
#
# Example program
#
# Makefile used to build the software
#
# Copyright 2015-2022 Nicolas Mora <mail@babelouest.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the MIT License
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
CC=gcc
ULFIUS_LOCATION=../../src
ULFIUS_INCLUDE=../../include
EXAMPLE_INCLUDE=../include
CFLAGS+=-c -Wall -D_REENTRANT $(ADDITIONALFLAGS) -I$(ULFIUS_INCLUDE) -I$(EXAMPLE_INCLUDE) $(CPPFLAGS)
LIBS=-lc -ljansson -lorcania -lulfius -L$(ULFIUS_LOCATION)
ifndef YDERFLAG
LIBS+= -lyder
endif
all: client server mail
clean:
rm -f *.o client server mail
debug: ADDITIONALFLAGS=-DDEBUG -g -O0
debug: client server mail
../../src/libulfius.so:
cd $(ULFIUS_LOCATION) && $(MAKE) debug GNUTLSFLAG=1
client.o: client.c ../../src/libulfius.so
$(CC) $(CFLAGS) client.c -DDEBUG -g -O0
client: client.o
$(CC) -o client client.o $(LIBS)
server.o: server.c ../../src/libulfius.so
$(CC) $(CFLAGS) server.c -DDEBUG -g -O0
server: server.o
$(CC) -o server server.o $(LIBS)
mail.o: mail.c ../../src/libulfius.so
$(CC) $(CFLAGS) mail.c -DDEBUG -g -O0
mail: mail.o
$(CC) -o mail mail.o $(LIBS)
|