improve makefile

master
Avril 4 years ago
parent 0e3d2f7e3b
commit 06314bcd48
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -46,17 +46,18 @@ pgo-generate: $(PGO_OBJ)
pgo-profile: pgo-generate pgo-profile: pgo-generate
for i in {1..$(PGO_ITERATIONS)}; do \ for i in {1..$(PGO_ITERATIONS)}; do \
dd if=/dev/urandom of=./pgo-test bs=1024 count=$(PGO_DATASET_SIZE) >> /dev/null 2>&1; \ dd if=/dev/urandom of=/tmp/$(PROJ)-pgo-test bs=1024 count=$(PGO_DATASET_SIZE) >> /dev/null 2>&1; \
printf "\rIteration $$i / $(PGO_ITERATIONS)"; \ printf "\rIteration $$i / $(PGO_ITERATIONS)"; \
./pgo-generate ./pgo-test > ./pgo-output; \ ./pgo-generate /tmp/$(PROJ)-pgo-test > /tmp/$(PROJ)-pgo-output; \
done done
@echo "" @echo ""
rm ./pgo-test rm /tmp/$(PROJ)-pgo-test
rm ./pgo-output rm /tmp/$(PROJ)-pgo-output
rm pgo-generate rm pgo-generate
pgo-use: PROF_FLAGS = -fprofile-use -lgcov pgo-use: PROF_FLAGS = -fprofile-use
pgo-use: LDFLAGS+= -lgcov
pgo-use: $(PGO_OBJ) pgo-use: $(PGO_OBJ)
$(CXX) $^ $(CXXFLAGS) $(PROF_FLAGS) -o $@ $(LDFLAGS) $(PROF_FLAGS) $(CXX) $^ $(CXXFLAGS) $(PROF_FLAGS) -o $@ $(LDFLAGS) $(PROF_FLAGS)

@ -20,7 +20,7 @@ const static constexpr char ascii_map[256] = {
'.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.',
}; };
constexpr const char* hex_map[256] = { constexpr const static char* hex_map[256] = {
"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f",
"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f",
@ -59,7 +59,7 @@ inline void hex02(std::uint8_t byte, char buffer[2])
buffer[1] =hex_map[byte][1]; buffer[1] =hex_map[byte][1];
} }
template<int N> template<std::size_t N>
inline __attribute__((always_inline)) void print_exact(const char (&ar)[N]) inline __attribute__((always_inline)) void print_exact(const char (&ar)[N])
{ {
fwrite(ar, N, 1, stdout); fwrite(ar, N, 1, stdout);

Loading…
Cancel
Save