Skip to content

Commit

Permalink
improved makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
alex van renen committed Nov 27, 2011
1 parent 6fed497 commit 6103430
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@

all: gda_lib
all: libgda

cf := -Werror -Wall -funroll-loops -O2 -Iinclude/gda
lf := -funroll-loop -O2
gtest_include := ../gtest/include
gtest_dir := ../gtest

cf := -Werror -Wall -O2 -Iinclude -g0 $(addprefix -I,$(gtest_include)) $(addprefix -I,$(gtest_dir)) $(opt)
lf := -funroll-loop -O2 -g0 $(addprefix -I,$(gtest_include)) $(addprefix -I,$(gtest_dir)) -pthread $(opt)

source := src/time.cpp src/string.cpp src/math.cpp src/server.cpp src/client.cpp
object := $(source:.cpp=.o)

gda_lib: $(object)
libgda: $(object)
mv src/*.o .
ar -rv libgda.a *.o
rm *.o

test_source := $(source) test/main.cpp test/test_string.cpp
test_object := $(test_source:.cpp=.o)

tester: $(test_object)
g++ -o tester $(test_object) $(addprefix $(gtest_dir),/gtest_lib.o) $(lf)

%o: %cpp
g++ -c -o $@ $< $(cf)


clean:
find . -name '*.o' -delete -o -name 'gda.a' -delete
find . -name '*.o' -delete -o -name 'libgda.a' -delete -o -name 'tester'

0 comments on commit 6103430

Please sign in to comment.