2019-06-02 06:25:25 +08:00
|
|
|
# Hide full compilation line:
|
2019-06-02 22:04:35 +08:00
|
|
|
ifneq ($(V),1)
|
|
|
|
Q?=@
|
|
|
|
endif
|
|
|
|
# To see full command lines, use make V=1
|
2018-11-16 23:05:48 +08:00
|
|
|
|
|
|
|
LIB_A = tinycbor.a
|
|
|
|
tinycbor_SOURCES = \
|
|
|
|
cborencoder.c \
|
|
|
|
cborencoder_close_container_checked.c \
|
|
|
|
cborerrorstrings.c \
|
|
|
|
cborparser.c \
|
|
|
|
cborparser_dup_string.c \
|
|
|
|
cborpretty.c \
|
|
|
|
cbortojson.c \
|
|
|
|
cborvalidation.c \
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2018-11-16 23:05:48 +08:00
|
|
|
CFILES = $(filter %.c, $(tinycbor_SOURCES))
|
|
|
|
CMDOBJS = $(CFILES:%.c=%.o)
|
|
|
|
CLEAN = $(CMDOBJS)
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2019-07-11 00:43:19 +08:00
|
|
|
platform = $(shell uname)
|
|
|
|
|
2018-11-16 23:05:48 +08:00
|
|
|
CC= gcc
|
|
|
|
CFLAGS= -O2 -Wall -Wno-unused-variable -Wno-unused-function
|
2018-11-30 00:59:46 +08:00
|
|
|
LIBS= $(SYSLIBS) $(MYLIBS)
|
2018-11-16 23:05:48 +08:00
|
|
|
DEFAULT_INCLUDES = -I. -I..
|
|
|
|
DEFS = -DHAVE_STDINT_H
|
|
|
|
|
2019-07-11 00:43:19 +08:00
|
|
|
ifeq ($(platform),Darwin)
|
|
|
|
AR= /usr/bin/ar rcs
|
|
|
|
RANLIB= /usr/bin/ranlib
|
|
|
|
else
|
2018-11-16 23:05:48 +08:00
|
|
|
AR= ar rcs
|
|
|
|
RANLIB= ranlib
|
2019-07-11 00:43:19 +08:00
|
|
|
endif
|
2018-11-16 23:05:48 +08:00
|
|
|
RM= rm -f
|
|
|
|
TST= echo
|
|
|
|
|
|
|
|
SYSLDFLAGS=
|
|
|
|
SYSLIBS=
|
|
|
|
|
|
|
|
MYLIBS=
|
|
|
|
MYOBJS=
|
|
|
|
|
2019-03-10 18:42:38 +08:00
|
|
|
$(LIB_A): $(CMDOBJS)
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [=] AR $@)
|
|
|
|
$(Q)$(AR) $(LIB_A) $(CMDOBJS)
|
|
|
|
$(Q)$(RANLIB) $(LIB_A)
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2019-03-10 18:42:38 +08:00
|
|
|
all: $(LIB_A)
|
|
|
|
|
2018-11-16 23:05:48 +08:00
|
|
|
clean:
|
2019-06-02 06:25:25 +08:00
|
|
|
$(Q)$(RM) $(CLEAN)
|
|
|
|
$(Q)$(RM) $(LIB_A)
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2018-11-16 23:05:48 +08:00
|
|
|
%.o: %.c
|
2019-06-02 06:25:25 +08:00
|
|
|
$(info [-] CC $<)
|
|
|
|
$(Q)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(CFLAGS) -c -o $@ $< $(LIBS)
|
2019-03-10 18:35:03 +08:00
|
|
|
|
2018-11-16 23:05:48 +08:00
|
|
|
.PHONY: all clean
|
|
|
|
|