72 lines
1.8 KiB
Makefile
72 lines
1.8 KiB
Makefile
#=======================================================================================
|
|
# Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg.
|
|
# All rights reserved.
|
|
# Use of this source code is governed by a MIT-style
|
|
# license that can be found in the LICENSE file.
|
|
#=======================================================================================
|
|
|
|
#CONFIGURE BUILD SYSTEM
|
|
TARGET = exe-$(TAG)
|
|
BUILD_DIR = ./$(TAG)
|
|
SRC_DIR = ./src
|
|
MAKE_DIR = ./
|
|
VIDEO_DIR = ./video
|
|
Q ?= @
|
|
|
|
#DO NOT EDIT BELOW
|
|
include $(MAKE_DIR)/config.mk
|
|
include $(MAKE_DIR)/include_$(TAG).mk
|
|
INCLUDES += -I$(SRC_DIR)/includes -I$(BUILD_DIR)
|
|
|
|
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))
|
|
CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(OPTIONS) $(INCLUDES)
|
|
|
|
${TARGET}: $(BUILD_DIR) $(VIDEO_DIR) $(OBJ)
|
|
$(info ===> LINKING $(TARGET))
|
|
$(Q)${LINKER} ${LFLAGS} -o $(TARGET) $(OBJ) $(LIBS)
|
|
|
|
$(BUILD_DIR)/%.o: %.c $(MAKE_DIR)/include_$(TAG).mk
|
|
$(info ===> COMPILE $@)
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
$(Q)$(GCC) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d
|
|
|
|
$(BUILD_DIR)/%.s: %.c
|
|
$(info ===> GENERATE ASM $@)
|
|
$(CC) -S $(CPPFLAGS) $(CFLAGS) $< -o $@
|
|
|
|
.PHONY: clean distclean mkvid tags info asm
|
|
|
|
clean:
|
|
$(info ===> CLEAN)
|
|
@rm -rf $(BUILD_DIR)
|
|
@rm -rf $(VIDEO_DIR)
|
|
@rm -f tags
|
|
|
|
distclean: clean
|
|
$(info ===> DIST CLEAN)
|
|
@rm -f $(TARGET)
|
|
|
|
mkvid:
|
|
gnuplot animate.plot
|
|
ffmpeg -framerate 10 -i ./video/%04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p out.mp4
|
|
|
|
info:
|
|
$(info $(CFLAGS))
|
|
$(Q)$(CC) $(VERSION)
|
|
|
|
asm: $(BUILD_DIR) $(ASM)
|
|
|
|
tags:
|
|
$(info ===> GENERATE TAGS)
|
|
$(Q)ctags -R
|
|
|
|
$(BUILD_DIR):
|
|
@mkdir $(BUILD_DIR)
|
|
|
|
$(VIDEO_DIR):
|
|
@mkdir $(VIDEO_DIR)
|
|
|
|
-include $(OBJ:.o=.d)
|