-LIBS=-lrt
-OBJS=main.o init.o actions1.o actions2.o score.o misc.o database/database.o
-SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO advent.text control
+CC=clang
+CCFLAGS=-O2 -std=c99 -Wall -Wextra -Wpedantic -fstack-protector -fstack-protector-all -pipe -mtune=native
+LIBS=
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Linux)
+ LIBS=-lrt
+endif
+
+OBJS=main.o init.o actions1.o actions2.o score.o misc.o database.o
+SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO adventure.text advent.text control misc.h main.h share.h funcs.h