-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
41 lines (28 loc) · 754 Bytes
/
Copy pathmakefile
File metadata and controls
41 lines (28 loc) · 754 Bytes
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
#!/bin/bash
# Makefile make me fast and accurate
CC = g++
FLAGS = -g -static -O2 -std=gnu++0x #-Wall -Wextra -Wformat=2
EXE = tsp
EXE_ARGS = input/test_1.in
SRC_DIR = src/
INCL = $(SRC_DIR)
SRC_FILES = tsp.cpp map.cpp tabusearch.cpp 2opt.cpp types.cpp naivegreedy.cpp simulatedannealing.cpp randomtour.cpp minspan.cpp
SOURCES = $(SRC_FILES:%.cpp=$(SRC_DIR)%.cpp)
CCFLAGS = -I. -I$(INCL)
BIN = bin/
OBJ = $(SOURCES:$(SRC_DIR)%.cpp=obj/%.o)
all: $(EXE)
cleanall: clean
rm -rf $(BIN)
clean:
rm -rf $(BIN)*
rm -f $(OBJ)
$(EXE): $(OBJ) | $(BIN)
$(CC) $(OBJ) $(CCFLAGS) $(FLAGS) -o $(BIN)$(EXE)
$(OBJ): $(SOURCES) | $(BIN)
$(CC) -c $(SOURCES) $(CCFLAGS) $(FLAGS)
mv *.o obj/
$(BIN):
mkdir -p $(BIN)
run_$(EXE):
$(BIN)$(EXE) $(EXE_ARGS)