-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
69 lines (45 loc) · 1.18 KB
/
Makefile
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
CC=g++
CXX=g++
VER=1.3a
ifdef windir
CFLAGS=-g -D_WINDOWS
CXXFLAGS=$(CFLAGS)
all: vgdbc.dll vgdbc_test.exe cpp1.exe
test: all
gvim -c "echo libcall('vgdbc.dll', 'test', 'libcall test')"
test2: vgdbc_test.exe
@$< "help"
vgdbc_test.exe vgdbc.dll: LDFLAGS=-lwsock32
vgdbc_test.exe: vgdbc.o vgdbc.dll
$(CC) $^ -o $@ $(LDFLAGS)
vgdbc.dll: vgdbc.o
$(CC) -shared $^ -o $@ $(LDFLAGS)
clean:
-rm -rf *.o vgdbc.dll vgdbc_test.exe
cpp1.exe: cpp1.cpp Makefile
$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS)
else # for linux:
CFLAGS=-g -fPIC -D_LINUX
CXXFLAGS=$(CFLAGS)
LDFLAGS=-ldl
all: libvgdbc.so vgdbc_test cpp1
test: all
export LD_LIBRARY_PATH=`pwd` && vi -c "echo libcall('libvgdbc.so', 'test', 'libcall test')"
test2: vgdbc_test
@$< "help"
vgdbc_test: vgdbc.o
$(CC) $^ -o $@ $(LDFLAGS)
libvgdbc.so: vgdbc.o
$(CC) -shared $^ -o $@ $(LDFLAGS)
clean:
-rm -rf *.o libvgdbc.so vgdbc_test
cpp1: cpp1.cpp Makefile
$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS)
endif
NAME=vgdb-$(VER)
DIST=$(NAME).tgz
dist:
git archive --format tgz --output $(DIST) --prefix=$(NAME)/ HEAD
@echo $(DIST) generated.
######
vgdbc.o: vgdbc.c Makefile