Project

General

Profile

root / trunk / compiler / cppAst / ast / Makefile @ 5

1 2 krennw
2
#
3
# AST MODULE
4
#
5
6
include ../../Makefile.inc
7
8
CPPFLAGS  = $(PRJCFLAGS) \
9
	-I.. \
10
	`pkg-config $(PROTOBUFFLAGS) --cflags $(PROTOBUFCONFIG)`
11
12
OBJLIBS = $(BUILDOUTPUTDIR)/libast.a
13
14
OBJOUTPUTDIR:=$(OBJOUTPUTDIR)/ast
15
16
OBJS    =  \
17
	$(OBJOUTPUTDIR)/serialize/gen/FunctionNames.pb.o \
18
	$(OBJOUTPUTDIR)/serialize/gen/Record.pb.o \
19
	$(OBJOUTPUTDIR)/serialize/ProtoBufAstTraversal.o \
20
	$(OBJOUTPUTDIR)/AstFactory.o \
21
	$(OBJOUTPUTDIR)/CompleteAstTraversalVisitor.o \
22
	$(OBJOUTPUTDIR)/ExpressionVisitor.o \
23
	$(OBJOUTPUTDIR)/StatementVisitor.o \
24
	$(OBJOUTPUTDIR)/PrintVisitor.o \
25
	$(OBJOUTPUTDIR)/Ast.o \
26
	$(OBJOUTPUTDIR)/DeepCloneVisitor.o \
27
	$(OBJOUTPUTDIR)/expressions/Expression.o \
28
	$(OBJOUTPUTDIR)/identifiers/Identifier.o \
29
	$(OBJOUTPUTDIR)/statements/Statement.o \
30
	$(OBJOUTPUTDIR)/types/Type.o \
31
	$(OBJOUTPUTDIR)/types/ActionSystemType.o \
32
	$(OBJOUTPUTDIR)/SymbolTable.o
33
34
all : subdirs $(OBJLIBS)
35
36
$(BUILDOUTPUTDIR)/%.a : $(OBJS)
37
	$(ECHO) $(AR) $(ARFLAGS) rv $@ $?
38
	$(AR) $(ARFLAGS) rv $@ $?
39
	$(ECHO) $(RANLIB) $@
40
	$(RANLIB) $@
41
42
subdirs:
43
	mkdir -p $(OBJOUTPUTDIR)/expressions
44
	mkdir -p $(OBJOUTPUTDIR)/identifiers
45
	mkdir -p $(OBJOUTPUTDIR)/statements
46
	mkdir -p $(OBJOUTPUTDIR)/types
47
	mkdir -p $(OBJOUTPUTDIR)/serialize
48
	mkdir -p $(OBJOUTPUTDIR)/serialize/gen
49
50
clean :
51
	$(ECHO) cleaning up in ast
52
	-$(RM) -f $(OBJS)
53
54
# pull in dependency info for *existing* .o files
55
-include $(OBJS:.o=.d)
56
57
force_look :
58
	true
59
60
include ../../Makefile.rules
61
62
# Default rule to compile a cc file (generated by protoc)
63
$(OBJOUTPUTDIR)/%.o: %.cc $(HEADERS)
64
	$(ECHO) "    compiling $@"
65
	$(CC)  -fPIC -c -o $@ $< $(CPPFLAGS)
66
	$(CC)  -fPIC -MT $@ -MM $(CPPFLAGS) $< > $(@:.o=.d)
67