-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 658 Bytes
/
Makefile
File metadata and controls
41 lines (32 loc) · 658 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
BIN = bin
PROGNAME =
OUT = lib/libmatrices.a
CC = g++
ODIR = obj
SDIR = src
CDIR = cache
INC = -Iinclude
LIB = -Llib
LIBMAT = -lmatrices
CFLAGS = -Wall -std=c++20
RUNS = runs
_OBJS = matrices/Matrices.o
OBJS = $(patsubst %, $(ODIR)/%, $(_OBJS))
$(ODIR)/%.o: $(SDIR)/%.cpp
$(CC) -c $(INC) -o $@ $< $(CFLAGS)
$(OUT): $(OBJS)
ar rvs $(OUT) $^
%.prog: $(SDIR)/%.cpp
mkdir -p $(BIN)
$(CC) -o $(patsubst %.prog, $(BIN)/%, $@) $< $(INC) $(CFLAGS)
all:
mkdir -p ./$(ODIR)/matrices
make $(ODIR)/matrices/Matrices.o
make $(OUT)
.PHONY: clean
clean:
rm -rf $(ODIR)/matrices/*.o $(BIN)/* $(CDIR)/*
cleanruns:
rm -rf $(RUNS)/*
cleanlib:
rm -rf $(OUT)