1# Copyright 2020 Michael Reilly (mreilly@resiliware.com).
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions
5# are met:
6# 1. Redistributions of source code must retain the above copyright
7#    notice, this list of conditions and the following disclaimer.
8# 2. Redistributions in binary form must reproduce the above copyright
9#    notice, this list of conditions and the following disclaimer in the
10#    documentation and/or other materials provided with the distribution.
11# 3. Neither the names of the copyright holders nor the names of the
12#    contributors may be used to endorse or promote products derived from
13#    this software without specific prior written permission.
14#
15# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
19# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27SRCDIR  := src
28BINDIR  := bin
29EXEC    := $(BINDIR)/server $(BINDIR)/client
30CC      ?= clang
31CFLAGS  ?= -O3 -Wall #-fPIC
32
33all: $(EXEC)
34
35clear:
36	rm -f $(EXEC)
37
38$(BINDIR)/server: $(SRCDIR)/server.c
39	$(CC) $(CFLAGS) -o $@ $(SRCDIR)/server.c
40
41$(BINDIR)/client: $(SRCDIR)/client.c
42	$(CC) $(CFLAGS) -o $@ $(SRCDIR)/client.c
43