##
# Makefile for server and client libs.
#


# config

DEFS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809 -D_XOPEN_SOURCE
override CFLAGS += -Wall -g -std=c99 -pedantic $(DEFS)
override LDFLAGS +=
override LIBS += -pthread -lrt

# objects for the server to build
OBJS = server_lib.o


# rules

all: $(OBJS) client osue-tool
	make -f Makefile.student all

client: client.o
	gcc $(LDFLAGS) -o $@ $^ $(LIBS)

osue-tool: osue-tool.c
	gcc -o $@ $^

%.o: %.c
	gcc $(CFLAGS) -c -o $@ $<
	strip -S $@

clean:
	make -f Makefile.student clean
	rm -f client client.o $(OBJS) osue-tool

distclean: clean
	rm -rf *.txt __pycache__
