aboutsummaryrefslogblamecommitdiff
path: root/lib/Makefile
blob: c880346f785f2a5088ce882ef60089dda1ad20f2 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                    






                            
                  
                        
                                    
                       
 
                                                                

                                                                

                                                                








                                      

                                            
# Copyright (c) 2020 Johannes Stoelp

ARCH ?= x86_64

ifeq ($(ARCH),arm64)
PREFIX := aarch64-linux-gnu-
endif

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

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