-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.win
107 lines (76 loc) · 2.37 KB
/
Makefile.win
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
#32 bits
CC = gcc.exe
CXX = g++.exe
AR = ar.exe
DEBUG=false
TARGET_BIT = 32
#EFLAGS = -fpic para compilar libreria std
EFLAGS = -L.out/
PROTO_BUF = -pthread -lprotobuf -pthread -lpthread
FLAGS = $(EFLAGS) -m$(TARGET_BIT) -lffi -Dcpu_arch=$(TARGET_BIT) -DMAX_HEAP_PROGRAM=1000000
CFLAGS = $(FLAGS)
CXXFLAGS = -std=c++11 $(FLAGS)
#CXXFLAGS="-std=c++17 $(FLAGS) $(pkg-config --cflags protobuf)"
#LIBS="$(pkg-config --libs protobuf)"
LIB_TARGET = out/libDvVm.dll
LIB_OBJ = src/DvVm/Vm.o \
src/numbers/numbers.o \
src/process/strings_sets.o \
src/strings/strings.o \
src/heap/heap.o \
src/stack/estack.o \
src/program/program.o \
src/process/cpu.o \
src/process/process.o \
src/process/lib.o
#src/process/native.o \
#src/process/natives.o \
#src/proto/objFile.pb.o descomentar para protobuf
#src/main.o
TARGET = out/DvVm.exe
OBJ = src/main.cpp $(LIB_TARGET)
compile: $(TARGET)
echo "DvVm compilado"
$(LIB_TARGET): $(LIB_OBJ)
echo "Empaquetando: " $@
$(CXX) -shared -o $@ $(LIB_OBJ) $(CXXFLAGS) -DDEBUG=${DEBUG} -Wl,--add-stdcall-alias
#$(AR) rcs $@ $^
$(TARGET): $(OBJ)
$(CXX) -o $@ $^ $(CXXFLAGS) -DDEBUG=${DEBUG}
%.o: %.cpp
$(CXX) -o $@ $(CXXFLAGS) -c $^ -DDEBUG=${DEBUG}
%.o: %.cc
$(CXX) -o $@ $(CXXFLAGS) -c $^ -DDEBUG=${DEBUG}
%.o: %.c
$(CC) -o $@ $(CFLAGS) -c $^ -DDEBUG=${DEBUG}
clear:
rm src/numbers/numbers.o &
rm src/program/program.o &
rm src/strings/strings.o &
rm src/process/*.o &
rm src/heap/heap.o &
rm src/DvVm/Vm.o &
rm src/stack/estack.o &
#rm src/proto/*.o &
#rm src/main.o &
#SRC_FILES = src/numbers/* src/types.h src/program/* src/process/* src/proto/* src/heap/* src/DvVm/* src/stack/* src/main.cpp
#LIBS = -Ilib/bfp-master/lib -pthread -lprotobuf -pthread -lpthread
##-I/usr/local/include -L/usr/local/lib -faggressive-loop-optimizations -O3
#CPP_FLAGS= -Dcpu_arch=64 -Wall -Wextra -g -std=c++11 -DMAX_HEAP_PROGRAM=1000
#CPP = g++
#compile:
# ${CPP} ${SRC_FILES} ${CPP_FLAGS} ${LIBS} -DDEBUG=false -o out/DvVm
#compile_debug:
# ${CPP} ${SRC_FILES} ${CPP_FLAGS} ${LIBS} -DDEBUG=true -o out/DvVmDB
#
#run:
# ./out/DvVm ${ARGS}
#compile_run: compile
# ./out/DvVm ${ARGS}
#clear:
# rm out/*
compile_protos:
protoc --cpp_out=src/proto objFile.proto
#proto_java:
# mkdir java_proto
# protoc --java_out=./java_proto/ objFile.proto