##
# Makefile for server.
#


# 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 to build
OBJS = server.o

# objects to link (already built)
LDOBJS = server_lib.o


# rules

.PHONY : all clean

all: server

server: $(OBJS) $(LDOBJS)
	gcc $(LDFLAGS) -o $@ $^ $(LIBS)

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

clean:
	rm -f server $(OBJS)


# dependencies

server.o: server.c
