2021-03-23 10:03:55 +01:00
|
|
|
TAG = GCC
|
2020-08-11 16:34:22 +02:00
|
|
|
|
|
|
|
#CONFIGURE BUILD SYSTEM
|
|
|
|
TARGET = MDBench-$(TAG)
|
|
|
|
BUILD_DIR = ./$(TAG)
|
|
|
|
SRC_DIR = ./src
|
|
|
|
MAKE_DIR = ./
|
2021-03-23 09:26:41 +01:00
|
|
|
FLAGS = -DAOS
|
2020-08-11 16:34:22 +02:00
|
|
|
Q ?= @
|
|
|
|
|
|
|
|
#DO NOT EDIT BELOW
|
|
|
|
include $(MAKE_DIR)/include_$(TAG).mk
|
|
|
|
INCLUDES += -I./src/includes
|
|
|
|
|
|
|
|
VPATH = $(SRC_DIR)
|
|
|
|
ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s,$(wildcard $(SRC_DIR)/*.c))
|
|
|
|
OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c))
|
2021-03-20 18:32:50 +01:00
|
|
|
CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(INCLUDES) ${FLAGS}
|
2020-08-11 16:34:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
${TARGET}: $(BUILD_DIR) $(OBJ)
|
|
|
|
@echo "===> LINKING $(TARGET)"
|
|
|
|
$(Q)${LINKER} ${LFLAGS} -o $(TARGET) $(OBJ) $(LIBS)
|
|
|
|
|
|
|
|
asm: $(BUILD_DIR) $(ASM)
|
|
|
|
|
|
|
|
$(BUILD_DIR)/%.o: %.c
|
|
|
|
@echo "===> COMPILE $@"
|
|
|
|
$(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
$(Q)$(CC) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d
|
|
|
|
|
|
|
|
$(BUILD_DIR)/%.s: %.c
|
|
|
|
@echo "===> GENERATE ASM $@"
|
|
|
|
$(Q)$(CC) -S $(ASFLAGS) $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
|
|
|
|
tags:
|
|
|
|
@echo "===> GENERATE TAGS"
|
|
|
|
$(Q)ctags -R
|
|
|
|
|
|
|
|
|
|
|
|
$(BUILD_DIR):
|
|
|
|
@mkdir $(BUILD_DIR)
|
|
|
|
|
|
|
|
ifeq ($(findstring $(MAKECMDGOALS),clean),)
|
|
|
|
-include $(OBJ:.o=.d)
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: clean distclean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "===> CLEAN"
|
|
|
|
@rm -rf $(BUILD_DIR)
|
|
|
|
@rm -f tags
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
@echo "===> DIST CLEAN"
|
|
|
|
@rm -f $(TARGET)
|
|
|
|
@rm -f tags
|