diff --git a/.gitignore b/.gitignore index 8dca753..fca4dea 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,8 @@ doxygen/ALL/ *.so *.pyc edn -edn-stripped +edn_debug +edn_release ################################### # Packages # diff --git a/Makefile b/Makefile index 5a610a4..06bb9bd 100644 --- a/Makefile +++ b/Makefile @@ -35,15 +35,20 @@ export CADRE_COTERS=' $(F_INVERSER) $(F_NORMALE) $(F_INVERSER) $(F_N ############################################################################### ### Compilateur base system ### ############################################################################### -CXX=$(BIN_PREFIX)g++ -CC=$(BIN_PREFIX)gcc -AR=$(BIN_PREFIX)ar +CXX=g++ +CC=gcc +AR=ar + +DEBUG:=1 ############################################################################### ### Compilation Define ### ############################################################################### -DEFINE= -DEDN_DEBUG_LEVEL=3 - +ifeq ("$(DEBUG)", "0") + DEFINE= -DEDN_DEBUG_LEVEL=1 -DNDEBUG +else + DEFINE= -DEDN_DEBUG_LEVEL=3 +endif GTKFLAGS= ifeq ($(shell if `pkg-config --exists gtk+-3.0` ; then echo "yes"; else echo "no"; fi), yes) @@ -86,13 +91,25 @@ LDFLAGS+= -Wl,--export-dynamic ############################################################################### ### Project Name ### ############################################################################### -OUTPUT_NAME=edn +PROG_NAME=edn ############################################################################### ### Basic Project description Files ### ############################################################################### FILE_DIRECTORY=Sources -OBJECT_DIRECTORY=Object +OUTPUT_NAME_RELEASE=$(PROG_NAME)_release +OUTPUT_NAME_DEBUG=$(PROG_NAME)_debug +OBJECT_DIR=Object + +ifeq ("$(DEBUG)", "0") + OBJECT_DIRECTORY=$(OBJECT_DIR)/release + OUTPUT_NAME = $(OUTPUT_NAME_RELEASE) +else + OBJECT_DIRECTORY=$(OBJECT_DIR)/debug + OUTPUT_NAME = $(OUTPUT_NAME_DEBUG) +endif + + ############################################################################### ### Generique dependency ### @@ -186,7 +203,7 @@ all: build -include $(OBJ:.o=.d) -build: .encadrer $(OUTPUT_NAME) $(MAKE_DEPENDENCE) +build: .encadrer $(OUTPUT_NAME) .encadrer: @@ -223,25 +240,26 @@ $(OBJECT_DIRECTORY)/%.o: $(FILE_DIRECTORY)/%.cpp $(MAKE_DEPENDENCE) @#echo $(CXX) $< -c -o $@ $(INCLUDE_DIRECTORY) $(CXXFLAGS) -MMD @$(CXX) $< -c -o $@ $(INCLUDE_DIRECTORY) $(CXXFLAGS) -MMD -# build binary -$(OUTPUT_NAME): $(OBJ) - @echo $(F_ROUGE)" (bin) $@ & $@-stripped"$(F_NORMALE) +# build binary Release Mode +$(OUTPUT_NAME_RELEASE): $(OBJ) $(MAKE_DEPENDENCE) + @echo $(F_ROUGE)" (bin) $@ "$(F_NORMALE) @$(CXX) $(OBJ) $(LDFLAGS) -o $@ - @cp $@ $@-stripped - @strip -s $@-stripped - @#cp $@-stripped ~/.bin/$@ + @cp $@ $(PROG_NAME) +# build binary Debug Mode +$(OUTPUT_NAME_DEBUG): $(OBJ) $(MAKE_DEPENDENCE) + @echo $(F_ROUGE)" (bin) $@ "$(F_NORMALE) + @$(CXX) $(OBJ) $(LDFLAGS) -o $@ + @cp $@ $(PROG_NAME) clean: @echo $(CADRE_HAUT_BAS) @echo ' CLEANING : $(F_VIOLET)$(OUTPUT_NAME)$(F_NORMALE)'$(CADRE_COTERS) @echo $(CADRE_HAUT_BAS) - @echo Remove Folder : $(OBJECT_DIRECTORY) - @rm -rf $(OBJECT_DIRECTORY) - @echo Remove File : $(OUTPUT_NAME) - @rm -f $(OUTPUT_NAME) - @echo Remove File : $(OUTPUT_NAME)-stripped - @rm -f $(OUTPUT_NAME)-stripped + @echo Remove Folder : $(OBJECT_DIR) + @rm -rf $(OBJECT_DIR) + @echo Remove File : $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE) + @rm -f $(PROG_NAME) $(OUTPUT_NAME_DEBUG) $(OUTPUT_NAME_RELEASE) @echo Remove File : pngToCpp @rm -f pngToCpp @echo Remove File : $(FILE_DIRECTORY)/GuiTools/myImage.* @@ -255,3 +273,18 @@ clean: count: wc -l Makefile `find $(FILE_DIRECTORY)/ -name "*.cpp"` `find $(FILE_DIRECTORY)/ -name "*.h"` +install: .encadrer $(OUTPUT_NAME_RELEASE) + @echo $(CADRE_HAUT_BAS) + @echo ' INSTALL : $(F_VIOLET)$(OUTPUT_NAME_RELEASE)=>$(PROG_NAME)$(F_NORMALE)'$(CADRE_COTERS) + @echo $(CADRE_HAUT_BAS) + @echo $(F_ROUGE)" (stripped) $(OUTPUT_NAME_RELEASE) => $(PROG_NAME) "$(F_NORMALE) + @cp $(OUTPUT_NAME_RELEASE) $(PROG_NAME) + @strip -s $(PROG_NAME) + @echo $(F_VERT)" (copy) $(PROG_NAME) ~/.bin/ "$(F_NORMALE) + @cp -vf $(PROG_NAME) ~/.bin/ + @echo $(F_VERT)" (data) data/* ==> ~/.edn/data/ "$(F_NORMALE) + @mkdir -p ~/.edn/data + @cp -vf data/*.xml ~/.edn/data + + + diff --git a/Sources/Colorize/ColorizeManager.cpp b/Sources/Colorize/ColorizeManager.cpp index c2ebaa8..a55d27e 100644 --- a/Sources/Colorize/ColorizeManager.cpp +++ b/Sources/Colorize/ColorizeManager.cpp @@ -60,7 +60,7 @@ void ColorizeManager::LoadFile(const char * xmlFilename) TiXmlElement* root = XmlDocument.FirstChildElement( "EdnColor" ); if (NULL == root ) { - EDN_ERROR(PFX"(l ?) main node not find: \"EdnColor\""); + EDN_ERROR(PFX"(l ?) main node not find: \"EdnColor\" in \"" << xmlFilename << "\""); return; } else diff --git a/Sources/Highlight/Highlight.cpp b/Sources/Highlight/Highlight.cpp index c13f430..9be05ca 100644 --- a/Sources/Highlight/Highlight.cpp +++ b/Sources/Highlight/Highlight.cpp @@ -52,7 +52,7 @@ Highlight::Highlight(Edn::String &xmlFilename) // open the curent File bool loadError = XmlDocument.LoadFile(xmlFilename.c_str()); if (false == loadError) { - EDN_ERROR( "can not load Hightlight XML: PARSING error: "); + EDN_ERROR( "can not load Hightlight XML: PARSING error: \"" << xmlFilename.c_str() << "\""); return; } TiXmlElement* root = XmlDocument.FirstChildElement( "EdnLang" ); diff --git a/Sources/Highlight/HighlightManager.cpp b/Sources/Highlight/HighlightManager.cpp index 0502e2c..795b03c 100644 --- a/Sources/Highlight/HighlightManager.cpp +++ b/Sources/Highlight/HighlightManager.cpp @@ -66,15 +66,36 @@ bool HighlightManager::Exist(Edn::String &fileName) void HighlightManager::loadLanguages(void) { - Edn::String xmlFilename = "./data/lang_c.xml"; + Edn::String homedir; +#ifdef NDEBUG + homedir = getenv("HOME"); + homedir += "/.edn/"; +#else + homedir = "./"; +#endif + + Edn::String xmlFilename = homedir; + xmlFilename += "data/lang_c.xml"; Highlight *myHightline = new Highlight(xmlFilename); listHighlight.push_back(myHightline); - xmlFilename = "./data/lang_boo.xml"; + xmlFilename = homedir; + xmlFilename += "data/lang_boo.xml"; myHightline = new Highlight(xmlFilename); listHighlight.push_back(myHightline); - xmlFilename = "./data/lang_Makefile.xml"; + xmlFilename = homedir; + xmlFilename += "data/lang_Makefile.xml"; + myHightline = new Highlight(xmlFilename); + listHighlight.push_back(myHightline); + + xmlFilename = homedir; + xmlFilename += "data/lang_asm.xml"; + myHightline = new Highlight(xmlFilename); + listHighlight.push_back(myHightline); + + xmlFilename = homedir; + xmlFilename += "data/lang_xml.xml"; myHightline = new Highlight(xmlFilename); listHighlight.push_back(myHightline); diff --git a/Sources/init.cpp b/Sources/init.cpp index cfa1d21..f353e61 100644 --- a/Sources/init.cpp +++ b/Sources/init.cpp @@ -79,7 +79,15 @@ int main (int argc, char *argv[]) // set color and other trucs... ColorizeManager *myColorManager = NULL; myColorManager = ColorizeManager::getInstance(); - myColorManager->LoadFile("./data/color_black.xml"); + Edn::String homedir; +#ifdef NDEBUG + homedir = getenv("HOME"); + homedir += "/.edn/"; +#else + homedir = "./"; +#endif + homedir += "data/color_black.xml"; + myColorManager->LoadFile( homedir.c_str() ); myColorManager->DisplayListOfColor(); HighlightManager *myHighlightManager = NULL; diff --git a/avancement.boo b/avancement.boo index b0e1df4..a3fd8c5 100644 --- a/avancement.boo +++ b/avancement.boo @@ -31,6 +31,7 @@ * matlab * java script * SQL + * Assembleur - project : list of current files open - gui : demander l'enregistrement avant de fermer (quand c'est nécessaire) - gui : demande de création de nouveaux fichier ou quiter l'editeur ... diff --git a/data/lang_Makefile.xml b/data/lang_Makefile.xml index 17ddf1a..5e6cf39 100644 --- a/data/lang_Makefile.xml +++ b/data/lang_Makefile.xml @@ -9,8 +9,53 @@ \n \ + + preprocesseur + ( *| [ \t]*)[A-Za-z0-9_+][^ \t]*[ \t]*(\+|:)?= + \n + \ + + Dependency Line + ^( *| [ \t]*)(.DEFAULT|.DELETE_ON_ERROR|.EXPORT_ALL_VARIABLES.IGNORE|.INTERMEDIATE|.PHONY|.POSIX|.PRECIOUS|.SECONDARY|.SILENT|.SUFFIXES)*(([A-Za-z0-9./$(){} _@^<*?%+-]*(\\\n)){,8}[A-Za-z0-9./$(){} _@^<*?%+-]*)::? + + \ No newline at end of file diff --git a/data/lang_asm.xml b/data/lang_asm.xml new file mode 100644 index 0000000..909ad6e --- /dev/null +++ b/data/lang_asm.xml @@ -0,0 +1,57 @@ + + + .s + .S + .asm + + + commentDoxygen + /\*\* + \*/ + + + comment + /\* + \*/ + + + preprocesseur + #[ \t]*if 0 + #endif|#else + \ + + + preprocesseur + # + \n + \ + + + commentDoxygen + //! + \n + + + SYNTAX_ERROR + //[ \t]*TODO[ \t]*: + \n + \ + + + comment + // + \n + \ + + + + + keyword + \@smull|ldrsh|smlal|stmdb|mul|mla|umull|ldr|add|str|mov|subs|bgt|ldmia|stmia|ldmfd|cmp|sub|strd|stmfd|bne|bhi|ldrd|mvn\@ + + + type + \@r(10|11|12|[0-9]?)|sp|lp|lr|pc\@ + + + diff --git a/data/lang_xml.xml b/data/lang_xml.xml new file mode 100644 index 0000000..41d3e64 --- /dev/null +++ b/data/lang_xml.xml @@ -0,0 +1,63 @@ + + + .xml + + + comment + <!\-\- + \-\-> + + + + + + + + +