# Makefile for the open-source release of adventure 2.5
-# You will need Python 3 YAML. Under Debian or ubuntu:
-#
-# apt-get install python3-yaml
-#
-# If you have pip installed,
-#
-# pip3 install PyYAML
-#
-# If you are using MacPorts on OS X:
-# port install py3{5,6}-yaml as appropriate for your Python 3 version.
-#
# To build with save/resume disabled, pass CCFLAGS="-D ADVENT_NOSAVE"
VERS=$(shell sed -n <NEWS '/^[0-9]/s/:.*//p' | head -1)
.PHONY: check coverage
CC?=gcc
-CCFLAGS+=-std=c99 -D_DEFAULT_SOURCE -DVERSION=\"$(VERS)\" -Wpedantic -O2
-LIBS=-ledit
+CCFLAGS+=-std=c99 -D_DEFAULT_SOURCE -DVERSION=\"$(VERS)\" -O2
+LIBS=$(shell pkg-config --libs libedit)
+INC+=$(shell pkg-config --cflags libedit)
+
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
LIBS+=-lrt
SOURCES=$(OBJS:.o=.c) advent.h adventure.yaml Makefile control make_dungeon.py
.c.o:
- $(CC) $(CCFLAGS) $(DBX) -c $<
+ $(CC) $(CCFLAGS) $(INC) $(DBX) -c $<
advent: $(OBJS) dungeon.o
$(CC) $(CCFLAGS) $(DBX) -o advent $(OBJS) dungeon.o $(LDFLAGS) $(LIBS)
linty: CCFLAGS += -W
linty: CCFLAGS += -Wall
linty: CCFLAGS += -Wextra
+linty: CCGLAGS += -Wpedantic
linty: CCFLAGS += -Wundef
linty: CCFLAGS += -Wstrict-prototypes
linty: CCFLAGS += -Wmissing-prototypes