looking-glass/c-host/Makefile

53 lines
1,006 B
Makefile
Raw Normal View History

USE_DXGI ?= 1
USE_XCB ?= 1
OUTPUT = looking-glass-host
EXT =
CFLAGS = -std=gnu99 -Wall -Werror
CFLAGS += -g -O3
CFLAGS += -I.
CFLAGS += -I../common
OBJS = app.o
# if windows
ifdef OS
2019-02-28 08:46:33 +00:00
CC = gcc.exe
LDFLAGS = -L./windows/dll -mwindows
LIBS += -lsetupapi
OBJS += windows/platform.o
OBJS += windows/windebug.o
CFLAGS += -I../vendor/kvm-guest-drivers-windows
EXT = .exe
ifeq ($(USE_DXGI), 1)
CFLAGS += -DUSE_DXGI -DCOBJMACROS -DINITGUID
LIBS += -ld3d11 -ldxgi
DLLS += windows/dll/libd3d11.a
OBJS += windows/capture/dxgi.o
endif
2019-02-28 08:31:04 +00:00
else
2019-02-28 08:46:33 +00:00
CC = gcc
2019-02-28 08:31:04 +00:00
OBJS += linux/platform.o
2019-03-01 01:54:15 +00:00
LIBS += -lpthread
ifeq ($(USE_XCB), 1)
CFLAGS += -DUSE_XCB
2019-03-02 00:59:03 +00:00
LIBS += -lxcb -lxcb-shm -lXfixes
OBJS += linux/capture/xcb.o
endif
endif
all: $(OBJS) $(DLLS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(OUTPUT)$(EXT) $(OBJS) $(LIBS)
clean:
rm -v $(OBJS) $(DLLS) $(OUTPUT)$(EXT)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.a: %.def
dlltool --def $< --output-lib $@