-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile_2
46 lines (33 loc) · 1.05 KB
/
Makefile_2
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
45
46
ALLH = LexicalParser SemanticParser
ALL = LexicalParser mainTest
PUBLIC = LexicalParser SemanticParser GrammaUtils
TARGET = mainTest
GEN = gen
INCLUDE = include /home/13774/x2-devel/include
SRC = src
TEST = test
LD = ld
CC = g++
CCFLAGS := $(patsubst %,-I %,$(INCLUDE)) -std=c++14 -D CODE64 -g
#==========================================
.ONESHELL:
.SECONDEXPANSION:
.PHONY : all clean run
run:$(patsubst %,$(GEN)/%.out,$(TARGET))
$<
all: $(patsubst %,$(GEN)/%.out,$(TARGET))
#check out for all
echo $^
$(patsubst %,$(GEN)/%.out,$(TARGET)):$(patsubst %,$(GEN)/%.o,$(PUBLIC)) $$(patsubst $(GEN)/%.out,$(GEN)/%.o,$$@)
#$(LD) $^ -o $@
$(CC) $^ -o $@
$(patsubst %,$(GEN)/%.o,$(PUBLIC)):$$(patsubst $$(GEN)/%.o,$$(SRC)/%.cpp,$$@)
$(CC) $(CCFLAGS) -c $< -o $@
$(patsubst %,$(GEN)/%.o,$(TARGET)):$$(patsubst $$(GEN)/%.o,$$(TEST)/%.cpp,$$@)
$(CC) $(CCFLAGS) -c $< -o $@
%.cpp:$(patsubst %,$(INCLUDE)/%.h,$(ALLH))
@echo check h files for cpp
Makefile:
@echo nothing to do with Makefile.
clean:
-rm -rf $(GEN)/*