Makefile
4.07 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#############################################
# make file for Anubis Virtual Machine
#
#
# Author: Alain Prouté
#
#
# Accessing directories. (This Makefile is in 'anubis_dev/vm/proj/linux')
#
DEVDIR = ../../..
SRCDIR = $(DEVDIR)/vm/src
TRDDIR = $(HOME)/third_dev
#
# Compiling options and where to find header files
#
OPTIMIZE = -g
INCLUDE = -I$(DEVDIR)/include -I$(SRCDIR)
#
# Object files by categories.
#
main_objs = vmalloc.o vm.o vmtools.o graphics.o sslstuff.o time.o linuxstuff.o\
AnubisAllocator.o AnubisFileLocker.o AnubisProcess.o IniFile.o List.o String.o\
FileIO.o DebugLog.o StringList.o MultiPath.o syscall.o serialize.o
# grammar.tab.o lex.yy.o
special_objs = anbexec.o
cipher_objs = sha1.o blowfish.o
graph_objs = host_graph.o
sqlite3_objs = alter.o analyze.o attach.o auth.o btree.o build.o callback.o complete.o\
date.o delete.o expr.o func.o hash.o insert.o legacy.o main.o opcodes.o\
os_unix.o os_win.o pager.o parse.o pragma.o prepare.o printf.o random.o\
select.o table.o tokenize.o trigger.o update.o\
utf.o util.o vacuum.o vdbeapi.o vdbeaux.o vdbe.o vdbefifo.o vdbemem.o\
where.o
#
# Making the virtual machine
#
all: anbexec
#
# Dependancies.
#
dependancies: $(main_objs:.o=.d) $(special_objs:.o=.d) $(cipher_objs:.o=.d) $(graph_objs:.o=.d)
dependancies_perso: $(main_objs:.o=.d) $(special_objs:.o=.perso.d) $(cipher_objs:.o=.d) $(graph_objs:.o=.d)
-include $(main_objs:.o=.d) $(special_objs:.o=.d) $(special_objs:.o=.perso.d)\
$(cipher_objs:.o=.d) $(graph_objs:.o=.d)
#
# Making the *.d files
#
%.perso.d: $(SRCDIR)/%.c
gcc $(INCLUDE) -MM $< > $@
%.d: $(SRCDIR)/%.c
gcc $(INCLUDE) -MM $< > $@
%.d: $(SRCDIR)/linux/%.c
gcc $(INCLUDE) -MM $< > $@
%.d: $(DEVDIR)/cipher/%.c
gcc $(INCLUDE) -MM $< > $@
#
# Making object files.
#
%.perso.o: $(SRCDIR)/%.c
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_\
-D_CRYPTADM_ $<
%.perso.o: $(SRCDIR)/%.cpp
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_\
-D_CRYPTADM_ $<
%.o: $(TRDDIR)/sqlite3/%.c
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -DNO_TCL $<
%.o: $(SRCDIR)/%.c
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_ $<
%.o: $(SRCDIR)/%.cpp
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_ $<
%.o: $(SRCDIR)/linux/%.c
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_ $<
%.o: $(SRCDIR)/linux/%.cpp
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_ $<
%.o: $(DEVDIR)/cipher/%.c
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_ $<
%.o: $(DEVDIR)/cipher/%.cpp
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_ $<
%.o: $(DEVDIR)/share/%.c
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_ $<
%.o: $(DEVDIR)/share/%.cpp
gcc $(OPTIMIZE) $(INCLUDE) -o $@ -c -Wall -Wstrict-prototypes -D_LINUX_ -D_WITH_GRAPHISM_ $<
#
# Using BISON and FLEX
#
$(SRCDIR)/grammar.tab.c $(SRCDIR)/grammar.tab.h: $(SRCDIR)/grammar.y
cd $(SRCDIR) && bison -l -v -d grammar.y
$(SRCDIR)/lex.yy.c: $(SRCDIR)/lexer.y $(SRCDIR)/grammar.tab.h
cd $(SRCDIR) && flex lexer.y
#
#
#
#construct.c.out construct.h.out: compilertypes.anubis
# myanubis compilertypes.anubis -dct
#
#weaktypes.c: compilertypes.anubis construct.c.out
# mv construc.c.out weaktypes.c
#
#weaktypes.h: compilertypes.anubis construct.h.out
# mv construc.h.out weaktypes.h
#
# Linking anbexec
#
anbexec: $(main_objs) $(special_objs) $(cipher_objs) $(graph_objs) $(sqlite3_objs)
gcc -o anbexec $(main_objs) $(special_objs) $(cipher_objs) $(graph_objs)\
$(sqlite3_objs) -L/usr/X11R6/lib\
-ljpeg -lssl -lcrypto -lm -lX11 -ldl -lstdc++ -lpthread -lc
strip anbexec
cp anbexec $(HOME)/anubis_distrib/linux_install/bin
# cp anbexec $(HOME)/bin/anbexec
clean:
rm -fr *.o *.d *~