uv_link_t/Makefile

44 lines
863 B
Makefile
Raw Normal View History

include config.mk
2016-05-26 01:09:19 -05:00
SRC = $(shell find src/ -type f -name '*.c')
OBJ = $(SRC:%=$(BUILD_DIR)/%.o)
H = include/uv_link_t.h
2016-05-27 11:24:23 -05:00
.PHONY: all static shared clean install-static install-shared install
2016-05-27 11:35:45 -05:00
all: static shared
static: $(SNAME)
shared: $(DNAME)
$(OBJ): config.mk
$(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)
2023-02-06 10:31:43 -06:00
install-header: $(H)
install -d $(DESTDIR)$(INCLUDEDIR)
install -m 644 $^ $(DESTDIR)$(INCLUDEDIR)
install-static: $(SNAME)
2023-02-06 10:31:43 -06:00
install -d $(DESTDIR)$(LIBDIR)
install -m 755 $^ $(DESTDIR)$(LIBDIR)
install-shared: $(DNAME)
2023-02-06 10:31:43 -06:00
install -d $(DESTDIR)$(LIBDIR)
install -m 755 $^ $(DESTDIR)$(LIBDIR)
install: install-header install-static install-shared