Skip to content

Commit 1b94de2

Browse files
committed
Fixed dependencies in the makefile.
1 parent d5a768a commit 1b94de2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ BOOST_DIR = "/home/alex/boost_1_65_1"
88

99
all: $(EXE)
1010

11-
$(EXE):
12-
$(CC) $(CCFLAGS) $(OPTFLAGS) $(INCLUDE) main.cpp sopang.cpp -o $@
11+
$(EXE): main.o sopang.o
12+
$(CC) $(CCFLAGS) $(OPTFLAGS) $(INCLUDE) main.o sopang.o -o $@
13+
14+
main.o: main.cpp params.hpp helpers.hpp
15+
$(CC) $(CCFLAGS) $(OPTFLAGS) $(INCLUDE) -c main.cpp
16+
17+
sopang.o: sopang.cpp sopang.hpp
18+
$(CC) $(CCFLAGS) $(OPTFLAGS) $(INCLUDE) -c sopang.cpp
1319

1420
.PHONY: clean
1521

1622
clean:
17-
rm -f $(EXE)
23+
rm -f main.o sopang.o $(EXE)
1824

1925
rebuild: clean all

0 commit comments

Comments
 (0)