mirror of
https://github.com/sigmasternchen/CFloor
synced 2025-03-15 04:18:55 +00:00
added lib target
This commit is contained in:
parent
5f6f451691
commit
5030fb80d9
1 changed files with 9 additions and 1 deletions
10
Makefile
10
Makefile
|
@ -2,13 +2,16 @@ CC = gcc
|
|||
CFLAGS = -std=c99 -Wall -D_POSIX_C_SOURCE=201112L -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -static -g
|
||||
LD = gcc
|
||||
LDFLAGS = -lpthread -lrt
|
||||
AR = ar
|
||||
ARFLAGS = rcs
|
||||
|
||||
BIN_NAME = cfloor
|
||||
LIB_NAME = libcfloor.a
|
||||
|
||||
OBJS = obj/networking.o obj/linked.o obj/logging.o obj/signals.o obj/headers.o obj/misc.o obj/status.o obj/files.o obj/mime.o obj/cgi.o obj/util.o obj/ssl.o obj/config.o
|
||||
DEPS = $(OBJS:%.o=%.d)
|
||||
|
||||
all: $(BIN_NAME) test
|
||||
all: $(BIN_NAME) $(LIB_NAME) test
|
||||
|
||||
ssl: CFLAGS += -DSSL_SUPPORT -Icrypto
|
||||
ssl: LDFLAGS += -lcrypto -lssl
|
||||
|
@ -17,6 +20,10 @@ ssl: obj/ssl.o $(BIN_NAME) test
|
|||
$(BIN_NAME): obj/main.o $(OBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $^
|
||||
|
||||
$(LIB_NAME): CFLAGS += -fPIC
|
||||
$(LIB_NAME): $(OBJS)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
test: obj/test.o $(OBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $^
|
||||
|
||||
|
@ -38,3 +45,4 @@ clean:
|
|||
@rm -f obj/*.d
|
||||
@rm -f test
|
||||
@rm -f $(BIN_NAME)
|
||||
@rm -f $(LIB_NAME)
|
||||
|
|
Loading…
Reference in a new issue