-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (31 loc) · 768 Bytes
/
Makefile
File metadata and controls
44 lines (31 loc) · 768 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
42
43
44
# Macro
cc := /usr/bin/g++
libs = -lncurses
libname = $(1)/lib$(1).a
ccflags = -std=c++17
# Rules
%.d : %.cc ; $(cc) $(ccflags) -c -MM -MT $(<:.cc=.o) -MT $(<:.cc=.d) -MF $(<:.cc=.d) $<
%.o : %.cc ; $(cc) $(ccflags) -c -o $@ $<
# Main target
all : demo
library = $(subst LIB,$(1),-lLIB -L./LIB)
modules := . curses metric
cflags += $(patsubst %,-I%,$(modules))
src =
targets =
#include ./module.mk
include $(patsubst %,%/module.mk,$(modules))
obj := $(src:.cc=.o)
dependents := $(src:.cc=.d)
include $(dependents)
clean:
rm --force $(targets)
rm --force $(src:.cc=.o)
rm --force $(dependents)
dump:
@echo ===========================
@echo libs: $(libs)
@echo src: $(src)
@echo obj: $(obj)
@echo targets: $(targets)
@echo dependets: $(dependents)