-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmakefile
78 lines (59 loc) · 1.62 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
#Makefile, including cross compilation examples.
#Enable module support: http://makoserver.net/documentation/c-modules/
CFLAGS += -DUSE_LUAINTF
#Enable the BAS functions required by the BarracudaDrive plugin (see basintf.h)
CFLAGS += -DUSE_BASINTF
#Enable forkpty and reverse proxy
CFLAGS += -DBAS_LOADED
CFLAGS += -DNDEBUG
# if compiled as: make build=debug
ifeq (debug,$(build))
CFLAGS += -g
else
#Optimize
CFLAGS += -O3 -Os
endif
#Defaults to native compilation
ifndef
CC=gcc
endif
ifndef
STRIP=strip
endif
BITS := $(shell getconf LONG_BIT)
ifeq ($(BITS), 64)
#The code will crash on 64 bit if BA_64BIT is not set.
CC+= -DBA_64BIT -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast
endif
#-------------------- Cross compilation examples:
#Command: make DD_WRT=true MIPS=true
ifdef DD_WRT
ifdef MIPS
ENDIAN=B_BIG_ENDIAN
GCCHOME=/disk2/toolchain-mips_r2_gcc-linaro_uClibc-0.9.32/
CC=$(GCCHOME)/bin/mips-openwrt-linux-gcc
STRIP=$(GCCHOME)/bin/mips-openwrt-linux-strip
endif
endif
#Command: make BEAGLEBOARD=true
ifdef BEAGLEBOARD
GCCHOME=/usr/local/ti-sdk-am335x-evm/linux-devkit
CC=$(GCCHOME)/bin/arm-arago-linux-gnueabi-gcc
STRIP=$(GCCHOME)/bin/arm-arago-linux-gnueabi-strip
endif
ifdef SHEEVAPLUG
GCCHOME=/FIXME
CC=$(GCCHOME)/bin/arm-none-linux-gnueabi-gcc
STRIP=$(GCCHOME)/bin/arm-none-linux-gnueabi-strip
endif
#Default is little endian CPU type
ifndef ENDIAN
ENDIAN=B_LITTLE_ENDIAN
$(warning Little endian assumed!)
endif
#----------------- Build
mako:*.c
$(CC) $(CFLAGS) -D$(ENDIAN) -DUSE_AMALGAMATED_BAS -fmerge-all-constants -finline-limit=50 -o mako -I./ *.c -lpthread -ldl -lm -lrt
ifneq (debug,$(build))
$(STRIP) mako
endif