+CURSES = ncursesw
+LDFLAGS = -s
+
+ifeq (Windows_NT,$(OS))
+ ifeq (,$(findstring CYGWIN,$(UNAME_S)))
+ CURSES := pdcurses
+ endif
+endif
+
+ifeq ($(UNAME_S),Darwin)
+ CURSES := ncurses
+ LDFLAGS :=
+endif
+
+ifeq ($(DEBUG),1)
+ LDFLAGS :=
+endif
+
+LDLIBS = -l$(CURSES)
+
+all: $(TARGET)
+
+$(TARGET): src
+ $(CC) $(OBJECTS) $(LDLIBS) $(LDFLAGS) -o $(TARGET)
+
+src:
+ $(MAKE) $(MFLAGS) -C src