-OBJS=main.o init.o actions1.o actions2.o score.o misc.o datime.o
-SOURCES=$(OBJS:.o=.c) COPYING NEWS README adventure.asc
+CC?=gcc
+CCFLAGS=-std=c99
+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