fix dependencies in Makefile
[qmc.git] / Makefile
blob8075fff5c54abf8f4862463f8d741ebd021854bd
1 CFLAGS=-O3 -march=core2
2 CXXFLAGS=-O3 -march=core2
3 LDFLAGS=-lm -ldl
4 SYSTEM=linux
5 LUA=lua-5.1.4
7 all: main analyze compute_weights
9 debug:
10 $(MAKE) CXXFLAGS="-g -ggdb" CFLAGS="-g -ggdb"
12 $(LUA).tar.gz:
13 wget http://www.lua.org/ftp/$(LUA).tar.gz
15 $(LUA)/src/liblua.a: $(LUA).tar.gz
16 tar -xvzf $(LUA).tar.gz
17 make -C $(LUA)/src liblua.a MYCFLAGS="-DLUA_USE_LINUX $(CFLAGS)"
19 main.o: Makefile .main.dep $(LUA)/src/liblua.a
20 analyze.o: Makefile .analyze.dep $(LUA)/src/liblua.a
21 compute_weights.o: Makefile .compute_weights.dep $(LUA)/src/liblua.a
23 .analyze.dep: analyze.cpp
24 $(CXX) -MM analyze.cpp > .analyze.dep
25 .compute_weights.dep: compute_weights.cpp
26 $(CXX) -MM compute_weights.cpp > .compute_weights.dep
27 .main.dep: main.cpp
28 $(CXX) -MM main.cpp > .main.dep
30 analyze: .analyze.dep analyze.o
31 $(CXX) $(LDFLAGS) -I$(LUA)/src analyze.o $(LUA)/src/liblua.a -o analyze
32 compute_weights: .compute_weights.dep compute_weights.o
33 $(CXX) $(LDFLAGS) -I$(LUA)/src compute_weights.o $(LUA)/src/liblua.a -o compute_weights
34 main: .main.dep main.o
35 $(CXX) $(LDFLAGS) -I$(LUA)/src main.o $(LUA)/src/liblua.a -o main
37 clean:
38 make -C $(LUA) clean
39 rm -f main main.o
41 .PHONY: clean default all
43 include .main.dep
44 include .analyze.dep
45 include .compute_weights.dep