-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile_compile
67 lines (49 loc) · 2.15 KB
/
Makefile_compile
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
# Makefile
THIS_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
include $(THIS_DIR)Makefile_vars
.SUFFIXES: .o .cpp .h .s
.PHONY: all clean rust
all: $(TARGETS)
$(CELLS_DIAGONAL_TARGET): $(CELLS_DIAGONAL_OBJS)
$(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
$(CELLS_UNPACKED_TARGET): $(CELLS_UNPACKED_OBJS)
$(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
$(CELLS_PACKED_TARGET): $(CELLS_PACKED_OBJS)
$(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
# Using Intel syntax assembly
%$(POSTFIX_DIAGONAL).o: %.cpp $(HEADERS) $(GENERATED_CODE)
$(CXX) -c $(CPPFLAGS) $(CPPFLAGS_DIAGONAL) $(CPPFLAGS_INTEL_SYNTAX) $< -o $@
%.o: %.cpp $(HEADERS) $(GENERATED_CODE)
$(CXX) -c $(CPPFLAGS) $(CPPFLAGS_INTEL_SYNTAX) $< -o $@
# Do not set -masm=intel for sources which include boost::thread
sudoku_boost$(POSTFIX_DIAGONAL).o: sudoku_boost.cpp $(HEADERS) $(GENERATED_CODE)
$(CXX) -c $(CPPFLAGS) $(CPPFLAGS_DIAGONAL) $< -o $@
sudoku_boost.o: sudoku_boost.cpp $(HEADERS) $(GENERATED_CODE)
$(CXX) -c $(CPPFLAGS) $< -o $@
sudokusse_cells_unpacked$(POSTFIX_DIAGONAL).o : sudokusse.s
$(AS) -defsym CellsPacked=0 -defsym DiagonalSudoku=1 $(ASFLAGS_SSE_AVX) -o $@ $<
sudokusse_cells_unpacked.o : sudokusse.s
$(AS) -defsym CellsPacked=0 -defsym DiagonalSudoku=0 $(ASFLAGS_SSE_AVX) -o $@ $<
sudokusse_cells_packed.o : sudokusse.s
$(AS) -defsym CellsPacked=1 -defsym DiagonalSudoku=0 $(ASFLAGS_SSE_AVX) -o $@ $<
$(HEADERS): ;
$(GENERATED_CODE) : $(GENERATOR_SCRIPTS)
ifneq (,$(RUBY))
$(RUBY) $(GENERATOR_SCRIPT_RUBY)
else
ifneq (,$(PYTHON))
$(PYTHON) $(GENERATOR_SCRIPT_PYTHON) $(GENERATED_CODE)
endif
endif
clean:
$(RM) $(TARGETS) $(TARGETS_RUST) $(OBJS) $(GENERATED_CODE) $(GENERATED_CODE_PYTHON) $(TEST_CASE_SOLUTION) $(TEST_CASE_SOLUTION_RUST) ./*.o
rust: $(TARGETS_RUST)
$(TARGETS_RUST): $(SOURCE_RUST)
cd $(RUST_DIR); $(CARGO) build $(CARGO_DEBUG_OPTIONS)
cd $(RUST_DIR); $(CARGO) test $(CARGO_DEBUG_OPTIONS)
head -1000 $(TEST_CASE_ORIGINAL_PUZZLE) | $(TARGET_RUST_DEBUG) > $(TEST_CASE_SOLUTION_RUST)
cd $(RUST_DIR); export RUSTFLAGS='$(RUSTFLAGS_AVX2)'; $(CARGO) build $(CARGO_RELEASE_OPTIONS)
#Local Variables:
#mode: Makefile
#coding: utf-8-dos
#End: