-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (23 loc) · 807 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
LIB_SRC = $(wildcard src/skicka/*.c) $(wildcard src/extern/*/**.c)
LIB_OBJS = $(patsubst %.c,%.o,$(LIB_SRC))
LIB_HEADERS = $(wildcard src/skicka/*.h) $(wildcard src/extern/*/**.h)
TEST_SRC = $(wildcard src/test/unittests/*.c)
TEST_OBJS = $(patsubst %.c,%.o,$(TEST_SRC))
TEST_HEADERS = $(wildcard src/test/unittests/*.h)
LIB_DIR = build
LIB_NAME = skicka
AR = ar
ARFLAGS = rcs
CC = gcc
CFLAGS = -Wall -O3 -std=c99 -Isrc/extern/jansson -c
LOADLIBES = -L./
all: $(TEST_OBJS) $(LIB_OBJS) $(LIB_HEADERS)
mkdir -p $(LIB_DIR)
$(AR) $(ARFLAGS) $(LIB_DIR)/lib$(LIB_NAME).a $(LIB_OBJS)
$(CC) $(TEST_OBJS) -o build/unittests -L$(LIB_DIR) -l$(LIB_NAME) -lcurl
$(LIB_OBJS) : $(LIB_SRC) $(LIB_HEADERS)
$(TEST_OBJS) : $(TEST_SRC) $(TEST_HEADERS)
clean:
rm -rf $(LIB_DIR)
rm -f $(LIB_OBJS)
rm -f $(TEST_OBJS)