[Makefile] make GUI configurable at compilation

This commit is contained in:
Gwenhael Le Moine 2023-09-17 16:08:11 +02:00
parent 3d70c997a4
commit 5263a13833
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -8,6 +8,7 @@ MAKEFLAGS +=-j$(NUM_CORES) -l$(NUM_CORES)
CC = gcc CC = gcc
GUI ?= sdl
OPTIM ?= 2 OPTIM ?= 2
CFLAGS = -g -O$(OPTIM) -I./src/ -D_GNU_SOURCE=1 -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DPATCHLEVEL=$(PATCHLEVEL) CFLAGS = -g -O$(OPTIM) -I./src/ -D_GNU_SOURCE=1 -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DPATCHLEVEL=$(PATCHLEVEL)
@ -18,6 +19,12 @@ ifeq ($(FULL_WARNINGS), yes)
CFLAGS += -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-unused-function -Wconversion -Wdouble-promotion -Wno-sign-conversion -fsanitize=undefined -fsanitize-trap CFLAGS += -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wno-unused-function -Wconversion -Wdouble-promotion -Wno-sign-conversion -fsanitize=undefined -fsanitize-trap
endif endif
### SDL UI
ifeq ($(GUI), sdl)
CFLAGS += $(shell pkg-config --cflags SDL_gfx sdl12_compat)
LIBS += $(shell pkg-config --libs SDL_gfx sdl12_compat)
endif
DOTOS = src/emu_serial.o \ DOTOS = src/emu_serial.o \
src/emu_emulate.o \ src/emu_emulate.o \
src/emu_init.o \ src/emu_init.o \
@ -27,15 +34,9 @@ DOTOS = src/emu_serial.o \
src/emu_timer.o \ src/emu_timer.o \
src/runtime_options.o \ src/runtime_options.o \
src/romio.o \ src/romio.o \
src/ui_$(GUI).o \
src/main.o src/main.o
### SDL1.2 UI
DOTOS += src/ui_sdl.o
CFLAGS += $(shell pkg-config --cflags SDL_gfx sdl12_compat)
LIBS += $(shell pkg-config --libs SDL_gfx sdl12_compat)
### /SDL1.2 UI
### debugger ### debugger
DOTOS += src/debugger.o DOTOS += src/debugger.o