Skip to content

Commit

Permalink
moved the makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
I3ck committed Jan 25, 2015
1 parent f404496 commit f97a30d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
*.cbp
*.test
*.swp
tests/bin/
tests/obj/
bin/
obj/
11 changes: 6 additions & 5 deletions tests/Makefile → Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CC = g++
DEBUG ?= 0
CFLAGS = -std=c++11

.PHONY: all, run_tests
.PHONY: tests, run_tests

ifeq ($(DEBUG), 1)
CFLAGS += -DDEBUG
Expand All @@ -13,12 +13,13 @@ else
endif


all: make_tests run_tests
tests: make_tests run_tests

make_tests:
$(CC) $(CFLAGS) -D USE_DOUBLE test_lib_2d.cpp -o $(TARGET)_DOUBLE
$(CC) $(CFLAGS) -D USE_LDOUBLE test_lib_2d.cpp -o $(TARGET)_LDOUBLE
$(CC) $(CFLAGS) -D USE_FLOAT test_lib_2d.cpp -o $(TARGET)_FLOAT
mkdir -p bin/
$(CC) $(CFLAGS) -D USE_DOUBLE tests/test_lib_2d.cpp -o $(TARGET)_DOUBLE
$(CC) $(CFLAGS) -D USE_LDOUBLE tests/test_lib_2d.cpp -o $(TARGET)_LDOUBLE
$(CC) $(CFLAGS) -D USE_FLOAT tests/test_lib_2d.cpp -o $(TARGET)_FLOAT

run_tests:
./$(TARGET)_DOUBLE
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ add `inc/` to your include path and `#include lib_2d.h` within your code


##testing
to make and run the tests
`cd tests/`
`make`
`make tests`
you can also use
`make clean`

Expand Down

0 comments on commit f97a30d

Please sign in to comment.