4 ifeq "$(origin CC)" "default"
8 PROGRAMS = as-dcpu16 vm-dcpu16
9 SOURCES = common.c dcpu16.c as-dcpu16.c vm-dcpu16.c display.c
11 CPPFLAGS += -DHAVE_LIBPNG -I/usr/X11/include/
12 CFLAGS = -g -Wall -Wextra -pedantic -std=c99
14 LDFLAGS += -L/usr/X11/lib -lpng
16 UNAME := $(shell uname)
17 ifeq ($(UNAME),Darwin)
18 CPPFLAGS += -DHAVE_FUNOPEN
21 # linux needs _GNU_SOURCE for fopencookie
22 # linux needs _XOPEN_SOURCE=600 (provided by _GNU_SOURCE) for getopt and strdup
23 CPPFLAGS += -DHAVE_FOPENCOOKIE -D_GNU_SOURCE
33 $(CC) $(CFLAGS) -MM $^ >> ./.depend
38 vm-dcpu16: vm-dcpu16.o dcpu16.o common.o display.o
40 as-dcpu16: as-dcpu16.o common.o
43 @rm -rf $(PROGRAMS) *.o *.dSYM .depend