mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-25 11:55:28 +01:00
1584349953
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
32 lines
763 B
Makefile
Executable File
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)
|