cflags.diff 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --- Makefile.orig 2019-12-22 07:58:45.850503487 -0800
  2. +++ Makefile 2019-12-22 08:17:35.475369649 -0800
  3. @@ -112,8 +112,8 @@
  4. # compiler settings
  5. PRE ?=
  6. -CC = $(PRE)gcc
  7. -CPP = $(PRE)g++
  8. +CC ?= $(PRE)gcc
  9. +CXX ?= $(PRE)g++
  10. STRIP = $(PRE)strip
  11. #-------------------------------------------------------------------------------
  12. @@ -243,7 +243,8 @@
  13. DCLIB_DIR := ./dclib
  14. DIR_LIST += $(DCLIB_DIR)
  15. VPATH += $(DCLIB_DIR)
  16. -CFLAGS += -I$(DCLIB_DIR)
  17. +CFLAGS ?= -O3 -funroll-loops
  18. +DEF_FLAGS := -I$(DCLIB_DIR)
  19. # other objects
  20. WIT_O := lib-std.o lib-file.o lib-sf.o \
  21. @@ -297,17 +298,17 @@
  22. DEFINES1 += -D_LZMA_PROB32=1 # LZMA option
  23. DEFINES = $(strip $(DEFINES1) $(MODE) $(XDEF))
  24. -CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -funroll-loops
  25. -CFLAGS += -Wall -Wno-parentheses -Wno-unused-function
  26. -#CFLAGS += -O3 -Isrc/libwbfs -Isrc/lzma -Isrc -I$(UI) -I. -Iwork
  27. -CFLAGS += -O3 -Isrc/libwbfs -Isrc -I$(UI) -I. -Iwork
  28. +DEF_FLAGS += -fomit-frame-pointer -fno-strict-aliasing
  29. +DEF_FLAGS += -Wall -Wno-parentheses -Wno-unused-function
  30. +#DEF_FLAGS += -Isrc/libwbfs -Isrc/lzma -Isrc -I$(UI) -I. -Iwork
  31. +DEF_FLAGS += -Isrc/libwbfs -Isrc -I$(UI) -I. -Iwork
  32. ifeq ($(SYSTEM),cygwin)
  33. - CFLAGS += -Wno-format-truncation
  34. + DEF_FLAGS += -Wno-format-truncation
  35. else ifeq ($(SYSTEM),mac)
  36. - CFLAGS += -I/usr/local/include
  37. + DEF_FLAGS += -I/usr/local/include
  38. endif
  39. -CFLAGS += $(XFLAGS)
  40. -CFLAGS := $(strip $(CFLAGS))
  41. +DEF_FLAGS += $(XFLAGS)
  42. +DEF_FLAGS := $(strip $(DEF_FLAGS))
  43. DEPFLAGS += -MMD
  44. @@ -371,7 +372,7 @@
  45. $(ALL_TOOLS_X): %: %.o $(ALL_OBJECTS) $(TOBJ_ALL) Makefile | $(HELPER_TOOLS)
  46. @printf "$(LOGFORMAT_TOOL)" tool "$@" "$(MODE) $(TOPT_$@) $(TOBJ_$@)"
  47. - @$(CC) $(CFLAGS) $(DEFINES) $(LDFLAGS) $@.o \
  48. + @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEFINES) $(LDFLAGS) $@.o \
  49. $(ALL_OBJECTS) $(TOBJ_$@) $(LIBS) $(TOPT_$@) -o $@
  50. @if test -f $@.exe; then $(STRIP) $@.exe; else $(STRIP) $@; fi
  51. @@ -384,7 +385,7 @@
  52. $(HELPER_TOOLS): %: %.o $(ALL_OBJECTS) $(UI_TABS) Makefile
  53. @printf "$(LOGFORMAT_TOOL)" helper "$@ $(TOBJ_$@)" "$(MODE)"
  54. - @$(CC) $(CFLAGS) $(DEFINES) $(LDFLAGS) $@.o \
  55. + @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEFINES) $(LDFLAGS) $@.o \
  56. $(ALL_OBJECTS) $(TOBJ_$@) $(LIBS) -o $@
  57. #--------------------------
  58. @@ -397,19 +398,19 @@
  59. $(UI_OBJECTS): %.o: %.c ui-%.c ui-%.h version.h Makefile
  60. @printf "$(LOGFORMAT_CC)" +object "$@" "$(MODE)"
  61. - @$(CC) $(CFLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
  62. + @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
  63. #--------------------------
  64. $(C_OBJECTS): %.o: %.c version.h Makefile $(TEXT_FILES)
  65. @printf "$(LOGFORMAT_CC)" object "$@" "$(MODE)"
  66. - @$(CC) $(CFLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
  67. + @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
  68. #--------------------------
  69. $(ASM_OBJECTS): %.o: %.S Makefile
  70. @printf "$(LOGFORMAT_CC)" asm "$@" "$(MODE)"
  71. - @$(CC) $(CFLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
  72. + @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(DEFINES) -c $< -o $@
  73. #--------------------------
  74. @@ -442,11 +443,11 @@
  75. $(LIBBZ2_OBJ): %.o: %.c Makefile
  76. @printf "$(LOGFORMAT_CC)" object "$(subst src/libbz2/,,$@)" "$(MODE) [libbz2]"
  77. - @$(CC) $(CFLAGS) $(DEPFLAGS) $(BZIP2_FLAGS) $(DEFINES) -c $< -o $@
  78. + @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(BZIP2_FLAGS) $(DEFINES) -c $< -o $@
  79. $(LZMA_OBJ): %.o: %.c Makefile
  80. @printf "$(LOGFORMAT_CC)" object "$(subst src/lzma/,,$@)" "$(MODE) [lzma]"
  81. - @$(CC) $(CFLAGS) $(DEPFLAGS) $(LZMA_FLAGS) $(DEFINES) -c $< -o $@
  82. + @$(CC) $(CFLAGS) $(DEF_FLAGS) $(DEPFLAGS) $(LZMA_FLAGS) $(DEFINES) -c $< -o $@
  83. #
  84. ###############################################################################
  85. @@ -658,6 +659,8 @@
  86. @echo ""
  87. @echo "CFLAGS: $(CFLAGS)"
  88. @echo ""
  89. + @echo "DEF_FLAGS: $(DEF_FLAGS)"
  90. + @echo ""
  91. @echo "LDFLAGS: $(LDFLAGS)"
  92. @echo ""
  93. @echo "LIBS: $(LIBS)"
  94. @@ -1005,7 +1008,7 @@
  95. @echo " make old enable '-DOLD_FEATURES'"
  96. @echo " make wait enable '-DWAIT'"
  97. @echo " make testtrace enable '-DTESTTRACE'"
  98. - @echo " make flags print DEFINES, CFLAGS and LDFLAGS"
  99. + @echo " make flags print DEFINES, CFLAGS, DEF_FLAGS and LDFLAGS"
  100. @echo ""
  101. @echo " make doc generate doc files from their templates"
  102. @echo " make distrib make all & build $(DISTRIB_PATH)"