forked from akheron/jansson
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
executable file
·49 lines (37 loc) · 1.37 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
BUILD_DIR ?= ../xl
include $(BUILD_DIR)/makefile.d/base.mk
CFLAGS += -Isrc -DHAVE_STDINT_H=1
# Fall back to OUTPUT_DIR. Keeps this build working if there is a mismatch with the xl repo.
LIBRARY_OUTPUT_DIR ?= $(OUTPUT_DIR)
JANSSON_A = $(LIBRARY_OUTPUT_DIR)/libjansson.a
HEADERS += src/jansson.h
HEADERS += src/jansson_config.h
HEADERS += src/hashtable.h
HEADERS += src/strbuffer.h
HEADERS += src/utf.h
HEADERS += src/jansson_private.h
OBJS += $(LIBRARY_OUTPUT_DIR)/dump.o
OBJS += $(LIBRARY_OUTPUT_DIR)/error.o
OBJS += $(LIBRARY_OUTPUT_DIR)/hashtable.o
OBJS += $(LIBRARY_OUTPUT_DIR)/hashtable_seed.o
OBJS += $(LIBRARY_OUTPUT_DIR)/load.o
OBJS += $(LIBRARY_OUTPUT_DIR)/memory.o
OBJS += $(LIBRARY_OUTPUT_DIR)/pack_unpack.o
OBJS += $(LIBRARY_OUTPUT_DIR)/strbuffer.o
OBJS += $(LIBRARY_OUTPUT_DIR)/strconv.o
OBJS += $(LIBRARY_OUTPUT_DIR)/utf.o
OBJS += $(LIBRARY_OUTPUT_DIR)/value.o
src/jansson_config.h: cppunit/jansson_config.h
cp $< $@
$(LIBRARY_OUTPUT_DIR):
$(VERBOSE)mkdir -p $(LIBRARY_OUTPUT_DIR)
$(LIBRARY_OUTPUT_DIR)/%.o: src/%.c $(HEADERS) | $(LIBRARY_OUTPUT_DIR)
$(CC) $(CFLAGS) $(PROFILE_FLAGS) -c $< -o $@
$(JANSSON_A): $(HEADERS) $(OBJS) | $(LIBRARY_OUTPUT_DIR)
echo $(findstring fPIC,$(CFLAGS))
$(AR) src $(JANSSON_A) $(OBJS)
clean:
rm -rf $(LIBRARY_OUTPUT_DIR) src/jansson_config.h
cleanall: clean
rm -rf build
all: $(JANSSON_A)