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
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.
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
)
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
41 SRCS
+=$(CONCOL_BASEDIR
)/fonts
/testfont.c
43 SRCS
+= $(CONCOL_BASEDIR
)/sdlconsole.c
44 CFLAGS
+=-DCONSOLE_FONT
=$(CONSOLE_FONT
)
45 CFLAGS
+=-DCONSOLE_BACKEND
=SDL_CONSOLE
47 SDL_LIBS
= -l
$(BACKEND
)
51 $(error need to set BACKEND to one of SDL
, SDL2 or NCURSES
)