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
96
97
98
99
100
101
102
103
104
105
106
107
108
|
--- Makefile.orig 2018-04-01 01:05:20.377566441 -0700
+++ Makefile 2018-04-01 01:05:59.596953701 -0700
@@ -243,7 +243,8 @@
DCLIB_DIR := ./dclib
DIR_LIST += $(DCLIB_DIR)
VPATH += $(DCLIB_DIR)
-CFLAGS += -I$(DCLIB_DIR)
+CFLAGS ?= -O3 -funroll-loops
+DEF_FLAGS += -I$(DCLIB_DIR)
# other objects
WIT_O := lib-std.o lib-file.o lib-sf.o \
@@ -297,15 +298,15 @@
DEFINES1 += -D_LZMA_PROB32=1 # LZMA option
DEFINES = $(strip $(DEFINES1) $(MODE) $(XDEF))
-CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -funroll-loops
-CFLAGS += -Wall -Wno-parentheses -Wno-unused-function
-#CFLAGS += -O3 -Isrc/libwbfs -Isrc/lzma -Isrc -I$(UI) -I. -Iwork
-CFLAGS += -O3 -Isrc/libwbfs -Isrc -I$(UI) -I. -Iwork
+DEF_FLAGS += -fomit-frame-pointer -fno-strict-aliasing
+DEF_FLAGS += -Wall -Wno-parentheses -Wno-unused-function
+#DEF_FLAGS += -Isrc/libwbfs -Isrc/lzma -Isrc -I$(UI) -I. -Iwork
+DEF_FLAGS += -Isrc/libwbfs -Isrc -I$(UI) -I. -Iwork
ifeq ($(SYSTEM),mac)
- CFLAGS += -I/usr/local/include
+ DEF_FLAGS += -I/usr/local/include
endif
-CFLAGS += $(XFLAGS)
-CFLAGS := $(strip $(CFLAGS))
+DEF_FLAGS += $(XFLAGS)
+DEF_FLAGS := $(strip $(DEF_FLAGS))
DEPFLAGS += -MMD
@@ -369,7 +370,7 @@
$(ALL_TOOLS_X): %: %.o $(ALL_OBJECTS) $(TOBJ_ALL) Makefile | $(HELPER_TOOLS)
@printf "$(LOGFORMAT_TOOL)" tool "$@" "$(MODE) $(TOPT_$@) $(TOBJ_$@)"
- @$(CC) $(CFLAGS) $(DEFINES) $(LDFLAGS) $@.o \
+ @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEFINES) $(LDFLAGS) $@.o \
$(ALL_OBJECTS) $(TOBJ_$@) $(LIBS) $(TOPT_$@) -o $@
@if test -f $@.exe; then $(STRIP) $@.exe; else $(STRIP) $@; fi
@@ -382,7 +383,7 @@
$(HELPER_TOOLS): %: %.o $(ALL_OBJECTS) $(UI_TABS) Makefile
@printf "$(LOGFORMAT_TOOL)" helper "$@ $(TOBJ_$@)" "$(MODE)"
- @$(CC) $(CFLAGS) $(DEFINES) $(LDFLAGS) $@.o \
+ @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEFINES) $(LDFLAGS) $@.o \
$(ALL_OBJECTS) $(TOBJ_$@) $(LIBS) -o $@
#--------------------------
@@ -395,19 +396,19 @@
$(UI_OBJECTS): %.o: %.c ui-%.c ui-%.h version.h Makefile
@printf "$(LOGFORMAT_CC)" +object "$@" "$(MODE)"
- @$(CC) $(CFLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
+ @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
#--------------------------
$(C_OBJECTS): %.o: %.c version.h Makefile $(TEXT_FILES)
@printf "$(LOGFORMAT_CC)" object "$@" "$(MODE)"
- @$(CC) $(CFLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
+ @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
#--------------------------
$(ASM_OBJECTS): %.o: %.S Makefile
@printf "$(LOGFORMAT_CC)" asm "$@" "$(MODE)"
- @$(CC) $(CFLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
+ @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
#--------------------------
@@ -440,11 +441,11 @@
$(LIBBZ2_OBJ): %.o: %.c Makefile
@printf "$(LOGFORMAT_CC)" object "$(subst src/libbz2/,,$@)" "$(MODE) [libbz2]"
- @$(CC) $(CFLAGS) $(DEPFLAGS) $(BZIP2_FLAGS) $(DEFINES) -c $< -o $@
+ @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(BZIP2_FLAGS) $(DEFINES) -c $< -o $@
$(LZMA_OBJ): %.o: %.c Makefile
@printf "$(LOGFORMAT_CC)" object "$(subst src/lzma/,,$@)" "$(MODE) [lzma]"
- @$(CC) $(CFLAGS) $(DEPFLAGS) $(LZMA_FLAGS) $(DEFINES) -c $< -o $@
+ @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(LZMA_FLAGS) $(DEFINES) -c $< -o $@
#
###############################################################################
@@ -656,6 +657,8 @@
@echo ""
@echo "CFLAGS: $(CFLAGS)"
@echo ""
+ @echo "DEF_FLAGS: $(DEF_FLAGS)"
+ @echo ""
@echo "LDFLAGS: $(LDFLAGS)"
@echo ""
@echo "LIBS: $(LIBS)"
@@ -1003,7 +1006,7 @@
@echo " make old enable '-DOLD_FEATURES'"
@echo " make wait enable '-DWAIT'"
@echo " make testtrace enable '-DTESTTRACE'"
- @echo " make flags print DEFINES, CFLAGS and LDFLAGS"
+ @echo " make flags print DEFINES, CFLAGS, DEF_FLAGS and LDFLAGS"
@echo ""
@echo " make doc generate doc files from their templates"
@echo " make distrib make all & build $(DISTRIB_PATH)"
|