-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.linux
66 lines (53 loc) · 1.62 KB
/
Makefile.linux
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
# Choose a C compiler. (Must be ANSI C capable).
CC = gcc -ffloat-store -frounding-math
STRIP = strip
RM = rm -f
OPT-FLAGS = -flto -O3
LD-FLAGS = -ffunction-sections -fdata-sections -Wl,--gc-sections
PGO-GEN = -fprofile-generate
PGO-USE = -fprofile-use
ifeq ($(debug), yes)
DBG-FLAGS = -g
OPT-FLAGS = -O0
STRIP = :
endif
CC += $(DBG-FLAGS) $(OPT-FLAGS) $(LD-FLAGS)
#
# 32bit emulator on Linux-x86
# CC = gcc -m32 -mfpmath=sse -msse2 -ffloat-store -frounding-math
#
# 32bit/64bit emulator on Linux-POWER
# CC = gcc [-m64] -ffloat-store -frounding-math -std=c99
#
# For a well-optimised version compiled with gcc on a Sun use:
# CFLAGS = -O2 -DSUN -finline -finline-functions -fexpensive-optimizations
# For a reasonably optimised version for NetBSD.
CFLAGS = -I. -Wall -DCURTERM=1 \
-DT4NANOMSG=1 \
-DT4SHLINKS=1 \
-DT4COMBINATIONS=1 \
-DT4RELEASE=1
# For a reasonably optimised version for SunOS 4.1.4.
# CFLAGS = -O2 -Wall -DSUN
# Put any additional libraries here.
LFLAGS = /usr/local/lib/libnanomsg.a -lanl -lpthread -lm
#
# https://github.com/JuliaMath/openlibm
#
FDMSRC = k_standard.c s_scalbn.c s_scalbnf.c s_ldexp.c s_ldexpf.c \
e_fmod.c e_remainder.c e_sqrt.c w_remainder.c w_sqrt.c
SRC = $(FDMSRC) curterm.c arithmetic.c fparithmetic.c netcfg.c shlink.c server.c p.c main.c
OBJ = $(SRC:.c=.o)
t4 : $(SRC)
$(CC) $(CFLAGS) $(SRC) $(LFLAGS) -o t4
$(STRIP) -s -x t4
ls -l t4
t4.profgen : $(SRC)
$(CC) $(PGO-GEN) $(CFLAGS) $(SRC) $(LFLAGS) -o t4
ls -l t4
t4.profuse : $(SRC)
$(CC) $(PGO-USE) $(CFLAGS) $(SRC) $(LFLAGS) -o t4
$(STRIP) -s -x t4
ls -l t4
clean :
$(RM) t4 $(OBJ) *.gcda