25 lines
360 B
Makefile
25 lines
360 B
Makefile
|
PR = test.elf
|
||
|
CC = gcc
|
||
|
CXX= g++ -std=c++17
|
||
|
AS = as
|
||
|
CFLAGS = -Wall -Os
|
||
|
MFLAGS = -o $(PR)
|
||
|
LFLAGS = -lpthread
|
||
|
|
||
|
all : $(PR)
|
||
|
|
||
|
OBJECTS = main.o usart.o baud.o
|
||
|
|
||
|
$(PR) : $(OBJECTS)
|
||
|
$(CXX) $(MFLAGS) $(OBJECTS) $(LFLAGS)
|
||
|
clean:
|
||
|
rm -f *.o *~
|
||
|
%.o : %.c
|
||
|
$(CC) -c $(CFLAGS) -o $@ $<
|
||
|
%.o : %.cpp
|
||
|
$(CXX) -c $(CFLAGS) -o $@ $<
|
||
|
%.o : %.s
|
||
|
$(AS) -o $@ $<
|
||
|
|
||
|
.PHONY : all clean
|