Merge pull request #157 from technomancy/makefile-add-static

Add lcurl.a target to makefile.
master
Alexey Melnichuk 2020-10-08 09:25:15 +03:00 committed by GitHub
commit 29d8667cc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -54,14 +54,22 @@ CF = $(INCLUDES) $(DEFINES) $(COMMONFLAGS) $(WARN) -DPTHREADS $(C
SCR = src/lua/*.lua src/lua/cURL/*.lua src/lua/cURL/impl/*.lua
SRCS = src/*.c
OBJS = $(subst src/,,$(subst .c,.o,$(SRCS)))
BIN = $(T).so
STATIC_LIB = $(T).a
all: $(BIN)
$(BIN): $(SRCS)
$(CC) $(CF) -o $@ $^ $(LF)
$(OBJS): $(SRCS)
$(CC) $(CF) -c $^ $(LF)
$(STATIC_LIB): $(OBJS)
ar rcs $@ $^
install: all
$(INSTALL) -d $(DESTDIR)$(LUA_CMOD) $(DESTDIR)$(LUA_LMOD)/cURL/impl
$(INSTALL) $(BIN) $(DESTDIR)$(LUA_CMOD)
@ -71,4 +79,4 @@ install: all
$(INSTALL) src/lua/cURL/impl/cURL.lua $(DESTDIR)$(LUA_LMOD)/cURL/impl
clean:
$(RM) -f $(BIN)
$(RM) -f $(BIN) $(OBJS) $(STATIC_LIB)