Commit c6e0aca0 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Makefile propre (pas besoin d'avoir 15 pour faire ca ^^)

parent 57b8c607
DIR_SRC = src
DIR_TESTS = tests
parser: ./tests/stub/trace.cpp ./tests/test_parser_event.cpp
cd ../trace/src/values && make && cd ../../../parser
cd ./src && make && cd ../
g++ -c ./tests/stub/trace.cpp -g -Wall -o trace.o
g++ -c ./tests/test_parser_event.cpp -Wall -o event_test.o
g++ -o ./tests/event_test event_test.o trace.o ../trace/src/values/*.o ./src/*.o
echo "event_test fait"
all:
@(cd $(DIR_SRC) && make)
debug:
@(cd $(DIR_TESTS) && make)
clean:
@(cd $(DIR_SRC) && make clean)
@(cd $(DIR_TESTS) && make clean)
rm -rf makefile~ *.*~
#parser: ./tests/stub/trace.cpp ./tests/test_parser_event.cpp
# cd ../trace/src/values && make && cd ../../../parser
# cd ./src && make && cd ../
# g++ -c ./tests/stub/trace.cpp -g -Wall -o trace.o
# g++ -c ./tests/test_parser_event.cpp -Wall -o event_test.o
# g++ -o ./tests/event_test event_test.o trace.o ../trace/src/values/*.o ./src/*.o
# echo "event_test fait"
......@@ -31,6 +31,14 @@ private:
*/
int typetoint(std::string);
/*!
* \fn valid_type(std::string &type_name)
* \brief Check if the type_name is a real type.
* \param name : the name we want to check.
* \return true if the type exists.
*/
bool is_valid_type(const std::string &type_name) const;
public:
/*!
......
......@@ -136,7 +136,7 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
}
extra_fields.push_back(&value);
}
else if(fields[i-1]._type == "integer" || fields[i-1]._type == "int") {
else if(fields[i-1]._type == "int") {
Integer value;
if(!Integer::instantiate(current_value, value)) {
cout << "warning : incompatible value" << endl;
......
CC = g++
LD = g++
OBJ = ../src/Line.o ../src/ParserDefinitionDecoder.o ../src/Definition.o ../src/TokenSource.o ../src/ParserEventDecoder.o ../src/ParserPaje.o
OBJ = ../../trace/src/values/*.o stub/*.o ../src/*.o
OPT = -g -Wall -W
all: test_token test_parser_definition test_parser_global
all: test_token test_parser_definition test_parser_global test_parser_evenement
test_token: test_token.cpp $(OBJ)
$(CC) $(OPT) -o $@ $^
......@@ -13,11 +13,12 @@ test_token: test_token.cpp $(OBJ)
test_parser_definition: test_parser_definition.cpp $(OBJ)
$(CC) $(OPT) -o $@ $^
test_parser_evenement: test_parser_event.cpp $(OBJ)
$(CC) $(OPT) -o $@ $^
test_parser_global: test_parser_global.cpp $(OBJ)
$(CC) $(OPT) -o $@ $^
$(OBJ):%.o: %.cpp %.hpp
$(LD) -c $< $(OPT) -o $@
clean:
$(RM) *.o *.*~ makefile~
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment