aboutsummaryrefslogtreecommitdiff
path: root/lib/Makefile
blob: 78b051e6c545232063c71d1e45ab7168917efabd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) 2020 Johannes Stoelp

AS       := gcc
ASFLAGS  := -g -O0
CXX      := g++
CXXFLAGS := -g -O0 -Wall -Wextra -I.
AR       := ar

ARCH := x86_64

libmatcha.a: thread.o executor.o                               \
             thread.h executor.h                               \
             arch/$(ARCH)/thread_create.o arch/$(ARCH)/yield.o \
             arch/$(ARCH)/init_stack.o                         \
             arch/$(ARCH)/api.h
	$(AR) rcs $@ $(filter %.o,$^)

%.o: %.cc
	$(CXX) -c -o $@ $^ $(CXXFLAGS)

%.o: %.s
	$(AS) -c -o $@ $^ $(ASFLAGS)

clean:
	find . -name '*.o' -exec rm -f {} \;
	rm -f libmatcha.a