include deps/nanopb/extra/nanopb.mk include config.mk SRC += $(shell find src/ -type f -name '*.c') PROTO = $(shell find src/ -type f -name '*.proto') OBJ = $(PROTO:%.proto=$(BUILD_DIR)/%.pb.c.o) OBJ += $(SRC:%=$(BUILD_DIR)/%.o) H = include/libumumble.h .PHONY: all static shared clean install-static install-shared install all: static shared static: $(SNAME) shared: $(DNAME) $(OBJ): config.mk $(PROTO) $(SNAME): $(OBJ) ar -rcs $@ $^ $(DNAME): LDFLAGS += -shared $(DNAME): $(OBJ) $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(BUILD_DIR)/%.c.o: %.c mkdir -p '$(@D)' $(CC) -c -o $@ $(INCLUDES) $(CFLAGS) $< clean: rm -rf $(SNAME) $(DNAME) $(BUILD_DIR) src/*.pb.h src/*.pb.c install-header: install -m 644 $(H) install-static: $(SNAME) install -m 755 $(SNAME) $(PREFIX)/lib64 install-shared: $(DNAME) install -m 755 $(DNAME) $(PREFIX)/lib64 install: install-header install-static install-shared