beltoforion / muparserx

A C++ Library for Parsing Expressions with Strings, Complex Numbers, Vectors, Matrices and more.
http://beltoforion.de/en/muparserx
BSD 2-Clause "Simplified" License
135 stars 60 forks source link

gcc makefile obj and bin directories #48

Closed jeffreyscottgraham closed 9 years ago

jeffreyscottgraham commented 9 years ago

The compile fails because the two directories 'obj' and 'bin' are assumed to exist

jeffreyscottgraham commented 9 years ago

Here is a patch (it also sets CC and CFLAGS only if not already set, since some of us do not use clang)

--- Makefile +++ Makefile @@ -1,8 +1,8 @@

CC = g++

CFLAGS = -O3 -Wall -pedantic -ffast-math -fomit-frame-pointer

-#CC = clang++ -#CFLAGS = llvm-config --ldflags -O3 -Wall -pedantic +CC ?= clang++ +CFLAGS ?= llvm-config --ldflags -O3 -Wall -pedantic

debug version

CFLAGS = -Wall -ggdb

@@ -29,7 +29,7 @@ PATH_SAMPLE = ./sample

-all: example +all: $(PATH_OBJ) $(PATH_BIN) example

new: clean example

@@ -76,3 +76,7 @@ new:
$(MAKE) clean $(MAKE) all + +$(PATH_OBJ) $(PATH_BIN):

nasailja commented 9 years ago

+1, I had to create bin and obj and use CC=c++ as clang++ didn't exist. I also had to add -std=c++11 to CFLAGS as GCC warned: ./sample/example.cpp:360:120: warning: ISO C++98 does not support the '%lf' gnu_printf format

beltoforion commented 9 years ago

The issue is now fixed in the current head revision (although i just added the folders to the repository)