Replace stupid gypkg build system with simple Makefile
This commit is contained in:
parent
b3ae0767c8
commit
c7b869f661
|
@ -5,3 +5,6 @@ out/
|
||||||
gypkg_deps/
|
gypkg_deps/
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
*.dll
|
||||||
|
|
44
Makefile
44
Makefile
|
@ -1,10 +1,40 @@
|
||||||
test: dist
|
include config.mk
|
||||||
./out/Release/uv_link_t-test
|
|
||||||
|
|
||||||
example: dist
|
SRC = $(shell find src/ -type f -name '*.c')
|
||||||
./out/Release/uv_link_t-example
|
OBJ = $(SRC:%=$(BUILD_DIR)/%.o)
|
||||||
|
H = include/uv_link_t.h
|
||||||
|
|
||||||
dist:
|
.PHONY: all static shared clean install-static install-shared install
|
||||||
gypkg build uv_link_t.gyp
|
|
||||||
|
|
||||||
.PHONY: test example dist
|
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)
|
||||||
|
|
||||||
|
install-header:
|
||||||
|
install -m 644 $(H) $(PREFIX)/include
|
||||||
|
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue