LookingGlass/client/Makefile

56 lines
1.2 KiB
Makefile
Raw Normal View History

BINARY = looking-glass-client
CFLAGS = -g -O3 -std=gnu99 -march=native -Wall -Werror -I./ -I../common -DDEBUG -DATOMIC_LOCKING
LDFLAGS = -lrt -lm
2017-10-19 04:15:49 +00:00
CFLAGS += -ffast-math
CFLAGS += -fdata-sections -ffunction-sections
LDFLAGS += -Wl,--gc-sections
CFLAGS += -Wfatal-errors
LIBS = sdl2 SDL2_ttf gl glu libssl openssl spice-protocol fontconfig x11 libconfig
LIBS += nettle hogweed
CFLAGS += -D USE_NETTLE
LDFLAGS += -lgmp
#LIBS += libssl openssl
#CFLAGS += -D USE_OPENSSL
CFLAGS += $(shell pkg-config --cflags $(LIBS))
LDFLAGS += $(shell pkg-config --libs $(LIBS))
BUILD ?= .build
BIN ?= bin
2017-10-19 04:15:49 +00:00
2017-12-10 22:23:58 +00:00
CFLAGS += -DBUILD_VERSION='"$(shell git describe --always --long --dirty --abbrev=10 --tags)"'
OBJS = main.o \
lg-renderer.o \
2018-05-29 01:06:55 +00:00
ll.o \
spice/rsa.o \
spice/spice.o \
2018-01-05 00:36:18 +00:00
parsers/nal.o \
decoders/null.o \
renderers/opengl.o
2017-12-02 05:39:44 +00:00
BUILD_OBJS = $(foreach obj,$(OBJS),$(BUILD)/$(obj))
all: $(BIN)/$(BINARY) $(BIN)/xlib-shim.so
$(BIN):
mkdir -p $@
$(BIN)/xlib-shim.so: $(BIN)
$(CC) -fPIC $(CFLAGS) -shared -o $@ xlib-shim.c
$(BUILD)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) -c $(CFLAGS) -o $@ $<
2017-10-19 04:15:49 +00:00
$(BIN)/$(BINARY): $(BIN) $(BUILD_OBJS)
$(CC) -o $@ $(BUILD_OBJS) $(LDFLAGS)
2017-10-19 04:15:49 +00:00
clean:
rm -rf $(BUILD) $(BIN)
.PHONY: clean