[client] Makefile rewrite from intial lazy version

This commit is contained in:
Geoffrey McRae 2017-12-05 18:03:41 +11:00
parent 310dba3620
commit 5c335fca67

View File

@ -1,24 +1,30 @@
BINARY=looking-glass-client BINARY = looking-glass-client
CFLAGS=-g -O3 -std=gnu99 -march=native -Wall -Werror -I../common -DDEBUG CFLAGS = -g -Og -std=gnu99 -march=native -Wall -Werror -I./ -I../common -DDEBUG
LDFLAGS=-lrt LDFLAGS = -lrt
CFLAGS+=`pkg-config --cflags sdl2` LIBS = sdl2 SDL2_ttf gl glu libssl openssl spice-protocol
LDFLAGS+=`pkg-config --libs sdl2` CFLAGS += $(shell pkg-config --cflags $(LIBS))
LDFLAGS += $(shell pkg-config --libs $(LIBS))
BUILD ?= .build
BIN ?= bin
CFLAGS+=`pkg-config --cflags SDL2_ttf` OBJS = main.o \
LDFLAGS+=`pkg-config --libs SDL2_ttf` spice/spice.o \
ivshmem/ivshmem.o
CFLAGS+=`pkg-config --cflags gl` BUILD_OBJS = $(foreach obj,$(OBJS),$(BUILD)/$(obj))
LDFLAGS+=`pkg-config --libs gl`
CFLAGS+=`pkg-config --cflags glu` all: $(BINARY)
LDFLAGS+=`pkg-config --libs glu`
CFLAGS+=`pkg-config --cflags libssl openssl` $(BUILD)/%.o: %.c
LDFLAGS+=`pkg-config --libs libssl openssl` @mkdir -p $(dir $@)
gcc -c $(CFLAGS) -o $@ $< $(LDFLAGS)
CFLAGS+=`pkg-config --cflags spice-protocol` $(BINARY): $(BUILD_OBJS)
@mkdir -p $(dir $(BIN)/$@)
gcc $(CFLAGS) -o $(BIN)/$(BINARY) $(BUILD_OBJS) $(LDFLAGS)
all: clean:
mkdir -p bin rm -rf $(BUILD) $(BIN)
gcc ${CFLAGS} -o bin/${BINARY} main.c spice/spice.c ivshmem/ivshmem.c ${LDFLAGS}
.PHONY: clean