2017-12-05 07:03:41 +00:00
|
|
|
BINARY = looking-glass-client
|
|
|
|
CFLAGS = -g -Og -std=gnu99 -march=native -Wall -Werror -I./ -I../common -DDEBUG
|
|
|
|
LDFLAGS = -lrt
|
2017-10-19 04:15:49 +00:00
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
LIBS = sdl2 SDL2_ttf gl glu libssl openssl spice-protocol
|
|
|
|
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-05 07:03:41 +00:00
|
|
|
OBJS = main.o \
|
|
|
|
spice/spice.o \
|
|
|
|
ivshmem/ivshmem.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
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
all: $(BINARY)
|
2017-11-18 23:46:20 +00:00
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
$(BUILD)/%.o: %.c
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
gcc -c $(CFLAGS) -o $@ $< $(LDFLAGS)
|
2017-10-19 04:15:49 +00:00
|
|
|
|
2017-12-05 07:03:41 +00:00
|
|
|
$(BINARY): $(BUILD_OBJS)
|
|
|
|
@mkdir -p $(dir $(BIN)/$@)
|
|
|
|
gcc $(CFLAGS) -o $(BIN)/$(BINARY) $(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
|