This repository has been archived by the owner on Apr 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (77 loc) · 2.34 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
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
ifndef TYPE
TYPE=static
endif
DEV=true
ifdef NDEBUG
DEV=false
endif
MAKEFLAGS += -s --no-print-directory -j 16
BASEDIR = .
SRCDIR = $(BASEDIR)/app
ULIBDIR=$(BASEDIR)/ulib
INCDIR=$(ULIBDIR)/include
OBJDIR=$(BASEDIR)/aso
ifeq ($(TYPE),static)
ULIB=libu.a
else
ULIB=libu.so.1.0
endif
ifndef CFLAGS
ifeq ($(DEV), true)
CFLAGS=-DFPS=30
else
CFLAGS=-DFPS=1000
endif
endif
CFLAGS += -std=c++11 -fPIC -DFD_SETSIZE=1024000
# Produktion
ifeq ($(DEV), true)
CFLAGS+=-g3 -O0 -fno-inline
else
CFLAGS+=-DNDEBUG -Os -fvisibility-inlines-hidden -g0 -gtoggle
endif
ifeq ($(TYPE), static)
LFLAGS=-Wl,-L$(ULIBDIR) -lz -lxml2 -lpthread -lu -static
else
LFLAGS=-Wl,-L$(ULIBDIR) -Wl,-rpath,$(ULIBDIR) -lpthread -lz -lxml2 -ldl -lstdc++
endif
CC=g++ $(CFLAGS)
INCLUDE=-I$(INCDIR)
H=
CPP=.cpp
O=.o
SRCFILES=$(wildcard $(SRCDIR)/*$(CPP))
FILES=$(patsubst $(SRCDIR)/%$(CPP),%,$(SRCFILES))
all: $(FILES)
$(MAKE) -C warp10server
echo "[`date`] Done."
#$(OBJDIR)/%$(O): $(SRCDIR)/%$(CPP)
# echo "[C] $*"
# $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
%: $(SRCDIR)/%$(CPP) $(ULIBDIR)/$(ULIB)
echo "[C] $@"
ifeq ($(TYPE),static)
$(CC) $(LFLAGS) $(CFLAGS) $(INCLUDE) -o $@ $< $(ULIBDIR)/$(ULIB) `g++ -print-file-name=libpthread.a`
else
$(CC) $(LFLAGS) $(CFLAGS) $(INCLUDE) -o $@ $< $(ULIBDIR)/$(ULIB) `g++ -print-file-name=libpthread.so` `g++ -print-file-name=libz.a`
endif
test: $(FILES)
if test -z "$(APP)"; then for i in $(FILES); do lc ./$$i; done; else lc ./$(APP); fi
clean:
rm $(FILES) >&2 2>/dev/null || true
$(MAKE) -C $(ULIBDIR) clean
$(MAKE) -C warp10server clean
$(ULIBDIR)/$(ULIB): $(wildcard $(ULIBDIR)/include/*) $(wildcard $(ULIBDIR)/include/**/*) $(wildcard $(ULIBDIR)/src/*.cpp) $(wildcard $(ULIBDIR)/src/**/*.cpp)
$(MAKE) -C $(ULIBDIR) $(ULIB)
ea:
rm -rf doc/EA 2>/dev/null || true
mkdir -p doc/EA/Framework 2>/dev/null || true
mkdir -p doc/EA/Server 2>/dev/null || true
for i in ulib/include/*; do dest=`echo $$i | sed "s:ulib/include/:doc/EA/Framework/:"`; cp $$i $$dest.h; done
for i in warp10server/include/*; do dest=`echo $$i | sed "s:warp10server/include/:doc/EA/Server/:"`; cp $$i $$dest.h; done
doc: /tmp/make_ulib_doc
echo "[$$(date)] Done."
/tmp/make_ulib_doc: $(wildcard $(ULIBDIR)/include/*) $(wildcard $(ULIBDIR)/include/**/*) $(wildcard warp10server/include/*) $(wildcard warp10server/include/**/*)
echo "[DOC] libu.sh"
cd tools/cppdoc2 && ./libu.sh
> $@