README: mention SDL2 backend
[rofl0r-concol.git] / dist / concol.mak
blobd993c281049aa0fb9383be1091ae9f07d8c13923
1 # this is a Makefile include file to embed into projects shipping
2 # concol as part of their release tarball.
4 # it assumes you have a SRCS variable in your Makefile that lists all required
5 # .c files, which are then converted into their object file companions.
6 # i.e. something like OBJS=$(SRCS:.c=.o)
7 # you need to set the following variables in the Makefile:
8 # CONCOL_BASEDIR : directory containing the concol sources
9 # BACKEND : must be set to one of SDL, SDL2 or NCURSES
10 # you probably want to make BACKEND variable user-choosable via a configure
11 # script or something, the results of which you include from your Makefile
12 # as well.
13 # in case you don't want to use pkg-config for NCURSES LDFLAGS, you can set
14 # the NCURSES_LIBS variable to e.g. -lncurses or similar.
15 # you can also set SDL_LIBS in a similar fashion, if the default of -lSDL
16 # doesn't work for you for some reason.
18 CONCOL_BASEDIR ?= .
19 PKG_CONFIG ?= pkg-config
21 SRCS += $(CONCOL_BASEDIR)/console.c
23 ifeq ($(BACKEND),NCURSES)
24 SRCS += $(CONCOL_BASEDIR)/ncconsole.c
25 SRCS += $(CONCOL_BASEDIR)/color_reader.c
26 ifeq ($(NCURSES_LIBS),)
27 NCURSES_LIBS := $(shell $(PKG_CONFIG) --libs ncurses)
28 endif
29 LIBS += $(NCURSES_LIBS)
30 CFLAGS+=-DCONSOLE_BACKEND=NCURSES_CONSOLE
31 CFLAGS+=-DCONSOLE_FONT=NOFONT
32 else ifeq ($(subst 2,,$(BACKEND)),SDL)
33 CONSOLE_FONT ?= INT10FONT14
34 ifeq ($(CONSOLE_FONT),INT10FONT14)
35 SRCS+=$(CONCOL_BASEDIR)/fonts/int10font14.c
36 else ifeq ($(CONSOLE_FONT),INT10FONT16)
37 SRCS+=$(CONCOL_BASEDIR)/fonts/int10font16.c
38 else ifeq ($(CONSOLE_FONT),INT10FONT08)
39 SRCS+=$(CONCOL_BASEDIR)/fonts/int10font08.c
40 else
41 SRCS+=$(CONCOL_BASEDIR)/fonts/testfont.c
42 endif
43 SRCS += $(CONCOL_BASEDIR)/sdlconsole.c
44 CFLAGS+=-DCONSOLE_FONT=$(CONSOLE_FONT)
45 CFLAGS+=-DCONSOLE_BACKEND=SDL_CONSOLE
46 ifeq ($(SDL_LIBS),)
47 SDL_LIBS = -l$(BACKEND)
48 endif
49 LIBS += $(SDL_LIBS)
50 else
51 $(error need to set BACKEND to one of SDL, SDL2 or NCURSES)
52 endif