Commit b83b9697 authored by nagayama15's avatar nagayama15

ビルドタイプごとに最適化の有無を切り替えるように変更

parent 8b51dbaf
.DEFAULT_GOAL := all
BUILD_TYPE := debug
BUILD_TYPE := release
ROOT := $(realpath ${PWD})
CD := $(realpath ${CURDIR})
......
......@@ -5,13 +5,18 @@ WATERMARK := 77
CC := clang
CFLAGS := \
-O2 \
-DBUILD_DIR="\"$$PWD/8cc\"" \
-DNDEBUG
-DBUILD_DIR="\"$$PWD/8cc\""
CFLAGS_debug := -O0
CFLAGS_release := -O2 -DNDEBUG
CFLAGS += ${CFLAGS_${BUILD_TYPE}}
8CCFLAGS := \
-DBUILD_DIR="\"$$PWD/8cc\"" \
-DNDEBUG
-DBUILD_DIR="\"$$PWD/8cc\""
8CCFLAGS_debug :=
8CCFLAGS_release := -DNDEBUG
8CCFLAGS += ${8CCFLAGS_${BUILD_TYPE}}
LDFLAGS := \
-no-pie
......
include ../../common.mk
RUSTFLAGS :=
RUSTFLAGS_debug :=
RUSTFLAGS_release := -O
RUSTFLAGS += ${RUSTFLAGS_${BUILD_TYPE}}
LDFLAGS := \
-pthread \
-lbacktrace \
......@@ -16,7 +21,7 @@ ${BIN_DIR}/%.out: ${OBJ_DIR}/%.ll ${OBJ_DIR}/probestack.o
${OBJ_DIR}/fizzbuzz.ll: fizzbuzz.rs
@mkdir -p ${@D}
rustc -O -Clto --emit=llvm-ir -o $@ $<
rustc ${RUSTFLAGS} -Clto --emit=llvm-ir -o $@ $<
${OBJ_DIR}/fizzbuzz-wm.ll: ${OBJ_DIR}/fizzbuzz.ll
@mkdir -p ${@D}
......
include ../../common.mk
CFLAGS :=
CFLAGS_debug := -O0
CFLAGS_release := -O2 -DNDEBUG
CFLAGS += ${CFLAGS_${BUILD_TYPE}}
SRCS := \
fizzbuzz.c
......@@ -26,7 +31,7 @@ ${BINS}: ${LLS} ${LLS_0} ${LLS_1} ${LLS_2} ${LLS_3}
${OBJ_DIR}/%.ll: %.c
@mkdir -p ${@D}
clang -emit-llvm -S -DNDEBUG -O2 -o $@ $<
clang -emit-llvm -S ${CFLAGS} -o $@ $<
%-0.ll: %.ll
opt -load=${ROOT}/bin/${BUILD_TYPE}/src/nykk.so -block-wm -watermark=0 -S -o $@ $< 2> ${@:.ll=.txt}
......
......@@ -2,7 +2,10 @@ include ../../common.mk
WATERMARK := lua-watermarking
CFLAGS := -O2 -DNDEBUG -DLUA_USE_LINUX
CFLAGS := -DLUA_USE_LINUX
CFLAGS_debug := -O0
CFLAGS_release := -O2 -DNDEBUG
CFLAGS += ${CFLAGS_${BUILD_TYPE}}
LDFLAGS := -lm -ldl
SRCS := \
......
......@@ -6,10 +6,12 @@ CC := clang
CXX := clang++
CFLAGS := \
-DNDEBUG \
-D_LARGEFILE64_SOURCE=1 \
-DHAVE_HIDDEN \
-O2
-DHAVE_HIDDEN
CFLAGS_debug := -O0
CFLAGS_release := -O2 -DNDEBUG
CFLAGS += ${CFLAGS_${BUILD_TYPE}}
CXXFLAGS := \
-std=c++17 \
......@@ -17,8 +19,11 @@ CXXFLAGS := \
-Wextra \
-pedantic \
-Werror \
-Izlib \
-O2
-Izlib
CXXFLAGS_debug := -O0
CXXFLAGS_release := -O2 -DNDEBUG
CXXFLAGS += ${CXXFLAGS_${BUILD_TYPE}}
SRCS := \
zlib/adler32.c \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment