X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=Makefile;h=1ecac46d40f73f94e96b87c3c86e1bea893befdc;hp=2560edffac3bade1fde45492e063c4862c7cf018;hb=HEAD;hpb=0a6b0889c67675bd71681ec41774d2ea57ce5335 diff --git a/Makefile b/Makefile index 2560edf..1ecac46 100644 --- 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,23 +15,25 @@ 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 # linux needs _XOPEN_SOURCE=600 (provided by _GNU_SOURCE) for getopt and strdup CPPFLAGS += -DHAVE_FOPENCOOKIE -D_GNU_SOURCE +# linux needs librt for clock_gettime +LDFLAGS += -lrt 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)