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

Ajout de Makefile pour la compilation

Déboggage 
parent 05318b73
......@@ -14,11 +14,13 @@
DIR_PARSER = parser
DIR_INTERFACE = interface
RM = rm
DIR_TRACE = trace/src
all:
@(cd $(DIR_INTERFACE) && make)
@(cd $(DIR_PARSER) && make)
@(cd $(DIR_TRACE) && make)
@echo " "
@echo "Compilation completed! File created in 'bin' folder."
@echo " "
......@@ -33,6 +35,7 @@ doc:
debugs:
@(cd $(DIR_INTERFACE) && make debugs)
# @(cd $(DIR_TRACE) && make)
@(cd $(DIR_PARSER) && make debug)
@echo " "
@echo "Compilation completed! (debug)"
......@@ -48,6 +51,8 @@ clean:
# Must be called with option -i, otherwise an error occured in the first instructions, the followings won't be executed.
wash:
@(cd $(DIR_TRACE) && make clean)
@(cd $(DIR_INTERFACE) && make clean)
@(cd $(DIR_PARSER) && make clean)
cd bin && $(RM) *
cd bin && $(RM) *
......@@ -11,18 +11,5 @@ debug:
clean:
@(cd $(DIR_SRC) && make clean)
@(cd $(DIR_TESTS) && make clean)
rm -rf makefile~ *.*~
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"
Linetest: ./src/TokenSource.cpp ./src/Line.cpp ./tests/test_ligne.cpp
g++ -c ./src/TokenSource.cpp -o ./src/TokenSource.o
g++ -c ./src/Line.cpp -o ./src/Line.o
g++ -c ./tests/test_ligne.cpp -o ./tests/test_ligne.o
g++ -o ./tests/test_ligne ./tests/test_ligne.o ./src/Line.o ./src/TokenSource.o
\ No newline at end of file
......@@ -13,7 +13,7 @@
#include "../../trace/src/values/Name.hpp"
#include "../../trace/src/values/String.hpp"
#include "../tests/stub/trace.hpp"
//#include "../../trace/src/Trace.hpp"
/**
* \class ParserEventDecoder
......
#include "../src/Line.hpp"
#include "../src/ParserDefinitionDecoder.hpp"
#include "../src/ParserEventDecoder.hpp"
#include "../..trace/src/Trace.hpp"
#include <iostream>
#include <fstream>
#include <cstdlib>
#include "ParserPaje.hpp"
#define DIE_IF(condition,message) if (condition){ \
......@@ -31,7 +24,6 @@ void ParserPaje::parse(string filename, Trace &trace){
if(line.starts_with(percent)){
parserdefinition->store_definition(line);
linecount ++;
}
else if (!line.item(0, event_identity_string)){
......
#ifndef PARSERPAJE_HPP
#define PARSERPAJE_HPP
#include <iostream>
#include <fstream>
//#include <cstdlib>
#include <string>
#include "../tests/stub/trace.hpp"
#include "ParserDefinitionDecoder.hpp"
#include "ParserEventDecoder.hpp"
#include "Parser.hpp"
#include "../src/Line.hpp"
#include "../../trace/src/Trace.hpp"
//#include "../tests/stub/trace.hpp"
/*!
*
......
......@@ -75,9 +75,10 @@ void TokenSource::build_composite_token(){
}
while(_buffer[_cursor] != '"');
_cursor ++;
if (ensure_capacity())
;
ensure_capacity();
}
void TokenSource::build_simple_token(){
while(_buffer[_cursor] != ' ' && _buffer[_cursor] != '\n' && _buffer[_cursor] != '\t'){
_token[_client_cursor] = _buffer[_cursor];
......
......@@ -3,6 +3,10 @@ CC = g++
LD = g++
OBJ = ../../trace/src/values/*.o stub/*.o ../src/*.o
DIR_SRC = ../src
DIR_STUB = stub
DIR_VALUES = ../../trace/src/values
OPT = -g -Wall -W
all: test_token test_parser_definition test_parser_evenement test_parser_paje
......@@ -16,10 +20,17 @@ test_parser_definition: test_parser_definition.cpp $(OBJ)
test_parser_evenement: test_parser_event.cpp $(OBJ)
$(CC) $(OPT) -o $@ $^
$(OBJ):
@(cd $(DIR_SRC) && make)
@(cd $(DIR_STUB) && make)
@(cd $(DIR_VALUES) && make)
test_parser_paje: test_parser_paje.cpp $(OBJ)
$(CC) $(OPT) -o $@ $^
clean:
$(RM) *.o *.*~ makefile~
@(cd $(DIR_SRC) && make clean)
@(cd $(DIR_STUB) && make clean)
@(cd $(DIR_VALUES) && make clean)
$(RM) *.o *.*~ Makefile~
LD = g++
OBJ = date.o name.o string.o trace.o
OPT = -g -Wall -W
LIBS =
all: $(OBJ)
$(OBJ):%.o: %.cpp %.hpp
$(LD) -c $< $(OPT)
clean:
$(RM) *.o *.*~ makefile~
LD = g++
OBJ = Container.o ContainerType.o Entity.o EntityType.o EntityValue.o State.o StateType.o # Trace.o -> A decommenter quand fait
OPT = -g -Wall -W
LIBS =
DIR_VALUES = values
all: $(OBJ)
$(OBJ):%.o: %.cpp %.hpp
$(LD) -c $< $(OPT)
@(cd $(DIR_VALUES) && make)
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