-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (41 loc) · 913 Bytes
/
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
CC=gcc
CPP=g++
CFLAGS=-Wall
CPPFLAGS=-Wall
MKDIR=mkdir -p
CSRCPATH=csrc
P6SRCPATH=p6src
CLIBPATH=clib
P6LIBPATH=p6lib
BINPATH=bin
SRCPATH=$(CSRCPATH) $(P6SRCPATH)
BUILD_DIRS=$(CLIBPATH) $(P6LIBPATH) $(BINPATH)
VPATH=$(SRCPATH)
.DEFAULT_GOAL := all
lib%.so: %.c
$(CC) $(CFLAGS) -shared -fPIC -o $(CLIBPATH)/$@ $<
lib%.so: %.cpp
$(CPP) $(CPPFLAGS) -shared -fPIC -o $(CLIBPATH)/$@ $<
%.out: %.c
$(CC) $(CFLAGS) -o $(BINPATH)/$@ $<
%.out: %.cpp
$(CPP) $(CPPFLAGS) -o $(BINPATH)/$@ $<
socketwrapper: libpinkstar.so pinkstar.out
print_const: print_const.out
$(BINPATH)/$< > $(P6LIBPATH)/SockConst.pm
.PHONY: ctypes
ctypes: ctypes.out
$(BUILD_DIRS):
$(MKDIR) $@
.PHONY: test
test: pyrawsocket.out
.PHONY: dirs
dirs: $(BUILD_DIRS)
.PHONY: clean
clean:
rm -rf $(P6SRCPATH)/.precomp
for dir in $(BUILD_DIRS); do \
rm -rf $$dir; \
done
.PHONY: all
all: | dirs socketwrapper print_const ctypes