2016-06-09 06:10:56 +08:00
|
|
|
#
|
|
|
|
# Copyright (c) 2016 Intel Corporation
|
|
|
|
#
|
2017-01-19 09:01:01 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2016-06-09 06:10:56 +08:00
|
|
|
#
|
|
|
|
|
2016-11-12 02:50:24 +08:00
|
|
|
O ?= $(error $$(O) is not set. Try `make all-mylib` from hello_world)
|
2016-06-09 06:10:56 +08:00
|
|
|
|
2016-11-12 02:50:24 +08:00
|
|
|
-include $(O)/Makefile.export
|
|
|
|
CFLAGS = $(KBUILD_CFLAGS) $(NOSTDINC_FLAGS) $(ZEPHYRINCLUDE)
|
|
|
|
OBJDIR=$(O)/mylib/obj
|
|
|
|
LIBDIR=$(O)/mylib/lib
|
2016-06-09 06:10:56 +08:00
|
|
|
|
|
|
|
all:
|
2016-11-12 02:50:24 +08:00
|
|
|
mkdir -p $(OBJDIR) $(LIBDIR)
|
|
|
|
$(CC) -c $(CFLAGS) -Iinclude src/mylib.c -o $(OBJDIR)/mylib.o
|
|
|
|
$(AR) -rcs $(LIBDIR)/libmylib.a $(OBJDIR)/mylib.o
|
2016-06-09 06:10:56 +08:00
|
|
|
|
|
|
|
clean:
|
2016-11-12 02:50:24 +08:00
|
|
|
rm -rf $(OBJDIR) $(LIBDIR)
|