CloverBootloader/BaseTools/Makefile
SergeySlice 1584349953 change GenFw for gcc11 compatibility
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
2021-10-06 22:52:32 +03:00

32 lines
763 B
Makefile
Executable File

PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
OBJS = BaseTools.o
ifeq ($(BUILD_MODE),debug)
CFLAGS += -g
else ifeq ($(BUILD_MODE),run)
CFLAGS += -O2
else ifeq ($(BUILD_MODE),linuxtools)
CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
LDFLAGS += -pg -fprofile-arcs -ftest-coverage
EXTRA_CLEAN += BaseTools.gcda BaseTools.gcno $(PROJECT_ROOT)gmon.out
EXTRA_CMDS = rm -rf BaseTools.gcda
else
$(error Build mode $(BUILD_MODE) not supported by this Makefile)
endif
all: BaseTools
BaseTools: $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $^
$(EXTRA_CMDS)
%.o: $(PROJECT_ROOT)%.cpp
$(CXX) -c $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) -o $@ $<
%.o: $(PROJECT_ROOT)%.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
clean:
rm -fr BaseTools $(OBJS) $(EXTRA_CLEAN)