mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-22 14:41:42 +00:00
API: Convert conditional building to the new scheme.
This fixes a build breakage with CONFIG_API enabled, which appeared after the recent changes in the U-Boot build system. Signed-off-by: Rafal Jaworowski <raj@semihalf.com>
This commit is contained in:
parent
98b742489c
commit
0dc1fc22af
3 changed files with 17 additions and 17 deletions
9
Makefile
9
Makefile
|
@ -253,9 +253,7 @@ LIBS += $(shell if [ -d post/board/$(BOARDDIR) ]; then echo \
|
||||||
"post/board/$(BOARDDIR)/libpost$(BOARD).a"; fi)
|
"post/board/$(BOARDDIR)/libpost$(BOARD).a"; fi)
|
||||||
LIBS += common/libcommon.a
|
LIBS += common/libcommon.a
|
||||||
LIBS += libfdt/libfdt.a
|
LIBS += libfdt/libfdt.a
|
||||||
ifeq ($(CONFIG_API),y)
|
|
||||||
LIBS += api/libapi.a
|
LIBS += api/libapi.a
|
||||||
endif
|
|
||||||
|
|
||||||
LIBS := $(addprefix $(obj),$(LIBS))
|
LIBS := $(addprefix $(obj),$(LIBS))
|
||||||
.PHONY : $(LIBS)
|
.PHONY : $(LIBS)
|
||||||
|
@ -266,11 +264,8 @@ PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -
|
||||||
# The "tools" are needed early, so put this first
|
# The "tools" are needed early, so put this first
|
||||||
# Don't include stuff already done in $(LIBS)
|
# Don't include stuff already done in $(LIBS)
|
||||||
SUBDIRS = tools \
|
SUBDIRS = tools \
|
||||||
examples
|
examples \
|
||||||
|
api_examples
|
||||||
ifeq ($(CONFIG_API),y)
|
|
||||||
SUBDIRS += api_examples
|
|
||||||
endif
|
|
||||||
|
|
||||||
.PHONY : $(SUBDIRS)
|
.PHONY : $(SUBDIRS)
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,12 @@ include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
LIB = $(obj)libapi.a
|
LIB = $(obj)libapi.a
|
||||||
|
|
||||||
COBJS = api.o api_net.o api_storage.o api_platform-$(ARCH).o
|
COBJS-$(CONFIG_API) += api.o api_net.o api_storage.o api_platform-$(ARCH).o
|
||||||
|
|
||||||
|
COBJS := $(COBJS-y)
|
||||||
SRCS := $(COBJS:.o=.c)
|
SRCS := $(COBJS:.o=.c)
|
||||||
OBJS := $(addprefix $(obj),$(COBJS))
|
OBJS := $(addprefix $(obj),$(COBJS))
|
||||||
|
|
||||||
all: $(LIB)
|
|
||||||
|
|
||||||
$(LIB): $(obj).depend $(OBJS)
|
$(LIB): $(obj).depend $(OBJS)
|
||||||
$(AR) $(ARFLAGS) $@ $(OBJS)
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
|
||||||
|
|
|
@ -30,19 +30,25 @@ endif
|
||||||
|
|
||||||
include $(TOPDIR)/config.mk
|
include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
ELF += demo
|
ELF-$(CONFIG_API) += demo
|
||||||
BIN += demo.bin
|
BIN-$(CONFIG_API) += demo.bin
|
||||||
|
ELF := $(ELF-y)
|
||||||
|
BIN := $(BIN-y)
|
||||||
|
|
||||||
#CFLAGS += -v
|
#CFLAGS += -v
|
||||||
|
|
||||||
COBJS := $(ELF:=.o)
|
COBJS-$(CONFIG_API) += $(ELF:=.o)
|
||||||
SOBJS := crt0.o
|
SOBJS-$(CONFIG_API) += crt0.o
|
||||||
ifeq ($(ARCH),ppc)
|
ifeq ($(ARCH),ppc)
|
||||||
SOBJS += ppcstring.o
|
SOBJS-$(CONFIG_API) += ppcstring.o
|
||||||
endif
|
endif
|
||||||
|
COBJS := $(COBJS-y)
|
||||||
|
SOBJS := $(SOBJS-y)
|
||||||
|
|
||||||
LIB = $(obj)libglue.a
|
LIB = $(obj)libglue.a
|
||||||
LIBCOBJS= glue.o crc32.o ctype.o string.o vsprintf.o libgenwrap.o
|
LIBCOBJS-$(CONFIG_API) += glue.o crc32.o ctype.o string.o vsprintf.o \
|
||||||
|
libgenwrap.o
|
||||||
|
LIBCOBJS := $(LIBCOBJS-y)
|
||||||
|
|
||||||
LIBOBJS = $(addprefix $(obj),$(SOBJS) $(LIBCOBJS))
|
LIBOBJS = $(addprefix $(obj),$(SOBJS) $(LIBCOBJS))
|
||||||
|
|
||||||
|
@ -55,7 +61,7 @@ gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
|
||||||
|
|
||||||
CPPFLAGS += -I..
|
CPPFLAGS += -I..
|
||||||
|
|
||||||
all: $(obj).depend $(OBJS) $(LIB) $(BIN) $(ELF)
|
all: $(obj).depend $(OBJS) $(LIB) $(ELF) $(BIN)
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
$(LIB): $(obj).depend $(LIBOBJS)
|
$(LIB): $(obj).depend $(LIBOBJS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue