b15f/driver/src/Makefile

44 lines
1.2 KiB
Makefile
Raw Normal View History

2019-03-26 08:57:01 +00:00
# Name: Makefile
# Project: B15F (board15 Famulus Edition)
# Author: Tristan Krause
# Creation Date: 2019-03-22
2019-04-03 13:20:49 +00:00
# Environment
2019-03-26 08:57:01 +00:00
COMPILER_PATH = g++
2019-04-03 13:20:49 +00:00
# Options
2019-05-15 08:37:23 +00:00
OUT_MAIN = main.elf
2019-04-03 13:20:49 +00:00
OBJ_MAIN = main.o
2019-05-15 08:37:23 +00:00
OUT_CLI = cli.elf
2019-04-03 13:20:49 +00:00
OBJ_CLI = cli.o
2019-05-15 08:55:32 +00:00
CFLAGS = -std=c++17 -O3 -Wall -Wextra
2019-04-05 06:47:06 +00:00
LDFLAGS = -lcurses -lpthread
2019-04-04 11:19:11 +00:00
OBJECTS_DRV = drv/usart.o drv/b15f.o drv/plottyfile.o drv/dot.o
2019-05-09 11:57:57 +00:00
OBJECTS_UI = ui/view.o ui/view_selection.o ui/view_promt.o ui/view_info.o ui/view_monitor.o ui/ui.o
2019-03-26 08:57:01 +00:00
COMPILE = $(COMPILER_PATH) $(CFLAGS)
2019-05-15 08:51:39 +00:00
all: drv cli
drv: $(OBJECTS_DRV) $(OBJ_MAIN)
2019-04-03 13:20:49 +00:00
@echo "Linking..."
2019-04-04 11:19:11 +00:00
$(COMPILE) $(OBJ_MAIN) $(OBJECTS_DRV) -o $(OUT_MAIN) $(LDFLAGS)
2019-04-03 13:20:49 +00:00
2019-04-04 11:19:11 +00:00
cli: $(OBJECTS_DRV) $(OBJECTS_UI) $(OBJ_CLI)
2019-03-26 08:57:01 +00:00
@echo "Linking..."
2019-04-04 11:19:11 +00:00
$(COMPILE) $(OBJ_CLI) $(OBJECTS_DRV) $(OBJECTS_UI) -o $(OUT_CLI) $(LDFLAGS)
2019-03-26 08:57:01 +00:00
help:
2019-05-15 08:51:39 +00:00
@echo "This Makefile compiles the b15f driver and command line interface (CLI):"
@echo "make ......... to compile all"
@echo "make drv ..... to compile the b15f driver"
@echo "make cli .... to compile the cli"
2019-04-03 13:20:49 +00:00
@echo "make clean ... to delete objects and executables"
2019-03-26 08:57:01 +00:00
clean:
@echo "Cleaning..."
2019-04-04 14:16:28 +00:00
rm -f $(OBJECTS_DRV) $(OBJECTS_UI) $(OBJ_CLI) $(OUT_CLI) $(OBJ_MAIN) $(OUT_MAIN)
2019-03-26 08:57:01 +00:00
.cpp.o:
$(COMPILE) -c $< -o $@