[yocto] [PATCH 4/6][rmc] use RMC_CFLAGS for internal compiler options.
Jianxun Zhang
jianxun.zhang at linux.intel.com
Tue Nov 22 11:35:47 PST 2016
The current RMC_CFLAGS worked as an interface for outside .But it
should be better to use this variable to hold internal flags and
respect CFLAGS passed from outside.
Also remove -O2 flag.
Signed-off-by: Jianxun Zhang <jianxun.zhang at linux.intel.com>
---
Makefile | 6 +++---
Makefile.efi | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index c5e1d11..9ade775 100644
--- a/Makefile
+++ b/Makefile
@@ -20,18 +20,18 @@ RMC_INSTALL_HEADER_PATH := $(RMC_INSTALL_PREFIX)/include/rmc/
ALL_OBJS := $(RMC_TOOL_OBJ) $(RMC_LIB_OBJ)
-CFLAGS := -Wall -O2 -I$(TOPDIR)/inc $(RMC_CFLAGS)
+RMC_CFLAGS := -Wall -I$(TOPDIR)/inc
all: rmc
$(ALL_OBJS): %.o: %.c
- @$(CC) -c $(CFLAGS) $< -o $@
+ @$(CC) -c $(CFLAGS) $(RMC_CFLAGS) $< -o $@
librmc: $(RMC_LIB_OBJ)
@$(AR) rcs src/lib/$@.a $^
rmc: $(RMC_TOOL_OBJ) librmc
- @$(CC) $(CFLAGS) -Lsrc/lib/ -lrmc $(RMC_TOOL_OBJ) src/lib/librmc.a -o src/$@
+ @$(CC) $(CFLAGS) $(RMC_CFLAGS) -Lsrc/lib/ -lrmc $(RMC_TOOL_OBJ) src/lib/librmc.a -o src/$@
clean:
@rm -f $(ALL_OBJS) src/rmc src/lib/librmc.a
diff --git a/Makefile.efi b/Makefile.efi
index 73a7ac1..3bd417d 100644
--- a/Makefile.efi
+++ b/Makefile.efi
@@ -13,12 +13,12 @@ RMC_INSTALL_PREFIX := /usr
RMC_INSTALL_LIB_PATH := $(RMC_INSTALL_PREFIX)/lib/
-CFLAGS := -DRMC_EFI -Wall -O2 -I$(TOPDIR)/inc -fpic -nostdinc -nostdlib -fno-builtin -std=gnu90 $(RMC_CFLAGS)
+RMC_CFLAGS := -DRMC_EFI -Wall -I$(TOPDIR)/inc -fpic -nostdinc -nostdlib -fno-builtin -std=gnu90
all: librmcefi
$(RMC_LIB_OBJ): %.efi.o: %.c
- @$(CC) -c $(CFLAGS) $< -o $@
+ @$(CC) -c $(CFLAGS) $(RMC_CFLAGS) $< -o $@
librmcefi: $(RMC_LIB_OBJ)
@$(AR) rcs src/lib/$@.a $^
--
2.7.4
More information about the yocto
mailing list