b15f/driver/src/Makefile

44 lines
1.2 KiB
Makefile
Raw Normal View History

2019-03-26 09:57:01 +01:00
# Name: Makefile
# Project: B15F (board15 Famulus Edition)
# Author: Tristan Krause
# Creation Date: 2019-03-22
2019-04-03 15:20:49 +02:00
# Environment
2019-03-26 09:57:01 +01:00
COMPILER_PATH = g++
2019-04-03 15:20:49 +02:00
# Options
2019-05-15 10:37:23 +02:00
OUT_MAIN = main.elf
2019-04-03 15:20:49 +02:00
OBJ_MAIN = main.o
2019-05-15 10:37:23 +02:00
OUT_CLI = cli.elf
2019-04-03 15:20:49 +02:00
OBJ_CLI = cli.o
CFLAGS = -std=c++14 -O3 -Wall -Wextra
2019-04-05 08:47:06 +02:00
LDFLAGS = -lcurses -lpthread
2019-04-04 13:19:11 +02:00
OBJECTS_DRV = drv/usart.o drv/b15f.o drv/plottyfile.o drv/dot.o
2019-05-09 13:57:57 +02: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 09:57:01 +01:00
COMPILE = $(COMPILER_PATH) $(CFLAGS)
2019-05-15 10:51:39 +02:00
all: drv cli
drv: $(OBJECTS_DRV) $(OBJ_MAIN)
2019-04-03 15:20:49 +02:00
@echo "Linking..."
2019-04-04 13:19:11 +02:00
$(COMPILE) $(OBJ_MAIN) $(OBJECTS_DRV) -o $(OUT_MAIN) $(LDFLAGS)
2019-04-03 15:20:49 +02:00
2019-04-04 13:19:11 +02:00
cli: $(OBJECTS_DRV) $(OBJECTS_UI) $(OBJ_CLI)
2019-03-26 09:57:01 +01:00
@echo "Linking..."
2019-04-04 13:19:11 +02:00
$(COMPILE) $(OBJ_CLI) $(OBJECTS_DRV) $(OBJECTS_UI) -o $(OUT_CLI) $(LDFLAGS)
2019-03-26 09:57:01 +01:00
help:
2019-05-15 10:51:39 +02: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 15:20:49 +02:00
@echo "make clean ... to delete objects and executables"
2019-03-26 09:57:01 +01:00
clean:
@echo "Cleaning..."
2019-04-04 16:16:28 +02:00
rm -f $(OBJECTS_DRV) $(OBJECTS_UI) $(OBJ_CLI) $(OUT_CLI) $(OBJ_MAIN) $(OUT_MAIN)
2019-03-26 09:57:01 +01:00
.cpp.o:
$(COMPILE) -c $< -o $@