2017-12-05 07:03:41 +00:00
|
|
|
BINARY = looking-glass-client
|
2017-12-30 13:27:26 +00:00
|
|
|
CFLAGS = -g -O3 -std=gnu99 -march=native -Wall -Werror -I./ -I../common -DDEBUG -DATOMIC_LOCKING
|
2017-12-05 07:03:41 +00:00
|
|
|
LDFLAGS = -lrt
|
2017-10-19 04:15:49 +00:00
|
|
|
|
2017-12-05 09:33:05 +00:00
|
|
|
CFLAGS += -ffast-math
|
|
|
|
CFLAGS += -fdata-sections -ffunction-sections
|
|
|
|
LDFLAGS += -Wl,--gc-sections
|
2018-01-05 00:45:30 +00:00
|
|
|
CFLAGS += -Wfatal-errors
|
2017-12-05 09:33:05 +00:00
|
|
|
|
2018-05-16 08:14:08 +00:00
|
|
|
LIBS = sdl2 SDL2_ttf gl glu libssl openssl spice-protocol fontconfig x11 libconfig
|
2018-05-21 23:49:35 +00:00
|
|
|
|
2018-05-22 05:36:36 +00:00
|
|
|
LIBS += nettle hogweed
|
|
|
|
CFLAGS += -D USE_NETTLE
|
|
|
|
LDFLAGS += -lgmp
|
2018-05-21 23:49:35 +00:00
|
|
|
|
2018-05-22 05:36:36 +00:00
|
|
|
#LIBS += libssl openssl
|
|
|
|
#CFLAGS += -D USE_OPENSSL
|
2018-05-21 23:49:35 +00:00
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
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)"'
|
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
OBJS = main.o \
|
2017-12-17 11:21:59 +00:00
|
|
|
lg-renderer.o \
|
2018-05-29 01:06:55 +00:00
|
|
|
ll.o \
|
2018-05-21 23:39:03 +00:00
|
|
|
spice/rsa.o \
|
2017-12-05 07:03:41 +00:00
|
|
|
spice/spice.o \
|
2018-01-05 00:36:18 +00:00
|
|
|
parsers/nal.o \
|
2017-12-29 11:48:21 +00:00
|
|
|
decoders/null.o \
|
2017-12-19 13:53:45 +00:00
|
|
|
renderers/opengl.o
|
2017-12-02 05:39:44 +00:00
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
BUILD_OBJS = $(foreach obj,$(OBJS),$(BUILD)/$(obj))
|
2017-11-18 23:46:20 +00:00
|
|
|
|
2018-01-24 22:55:21 +00:00
|
|
|
all: $(BIN)/$(BINARY) $(BIN)/xlib-shim.so
|
|
|
|
|
2018-01-29 06:02:41 +00:00
|
|
|
$(BIN):
|
2018-01-29 06:04:08 +00:00
|
|
|
mkdir -p $@
|
2018-01-29 06:02:41 +00:00
|
|
|
|
|
|
|
$(BIN)/xlib-shim.so: $(BIN)
|
2018-01-24 22:58:03 +00:00
|
|
|
$(CC) -fPIC $(CFLAGS) -shared -o $@ xlib-shim.c
|
2017-11-18 23:46:20 +00:00
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
$(BUILD)/%.o: %.c
|
|
|
|
@mkdir -p $(dir $@)
|
2018-01-24 22:58:03 +00:00
|
|
|
$(CC) -c $(CFLAGS) -o $@ $<
|
2017-10-19 04:15:49 +00:00
|
|
|
|
2018-01-29 06:02:41 +00:00
|
|
|
$(BIN)/$(BINARY): $(BIN) $(BUILD_OBJS)
|
2018-01-24 22:58:03 +00:00
|
|
|
$(CC) -o $@ $(BUILD_OBJS) $(LDFLAGS)
|
2017-10-19 04:15:49 +00:00
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
clean:
|
|
|
|
rm -rf $(BUILD) $(BIN)
|
|
|
|
|
|
|
|
.PHONY: clean
|