moved module/hw fields around
[dcpu16] / Makefile
index 2560edffac3bade1fde45492e063c4862c7cf018..4dcde613241b5595f8829ebf4fe6f0e34138e8c8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,10 @@
 ifeq "$(origin CC)" "default"
 CC = clang
 endif
+ifeq ($(CC),gcc)
+CPPFLAGS += -DWANT_VARIADIC_VOIDP_CAST
+endif
+
 
 PROGRAMS = as-dcpu16 vm-dcpu16
 SOURCES = common.c dcpu16.c as-dcpu16.c vm-dcpu16.c \
@@ -11,14 +15,14 @@ SOURCES = common.c dcpu16.c as-dcpu16.c vm-dcpu16.c \
 
 CPPFLAGS += -DDEBUG
 
-CPPFLAGS += -DHAVE_LIBPNG -I/usr/X11/include/
 CFLAGS = -g -Wall -Wextra -pedantic -std=c99
-LDFLAGS += -lreadline
-LDFLAGS += -L/usr/X11/lib -lpng
 
 UNAME := $(shell uname)
 ifeq ($(UNAME),Darwin)
 CPPFLAGS += -DHAVE_FUNOPEN
+# libpng from system x11, libvncserver from macports
+CPPFLAGS += -I/usr/X11/include -I/opt/local/include
+LDFLAGS += -L/usr/X11/lib -L/opt/local/lib
 endif
 ifeq ($(UNAME),Linux)
 # linux needs _GNU_SOURCE for fopencookie
@@ -26,8 +30,8 @@ ifeq ($(UNAME),Linux)
 CPPFLAGS += -DHAVE_FOPENCOOKIE -D_GNU_SOURCE
 endif
 
-CPPFLAGS += -DHAVE_LIBVNCSERVER -I/opt/local/include
-LDFLAGS += -L/opt/local/lib -lvncserver
+CPPFLAGS += -DHAVE_LIBVNCSERVER -DHAVE_LIBPNG
+LDFLAGS += -lvncserver -lpng -lreadline
 
 all:   $(PROGRAMS)