Permalink
Browse files

Prettify Makefile a bit

 - Generate and use depends
 - Hide ugly command printouts by default
 - Enable more warnings
 - Few warnings fixed
  • Loading branch information...
1 parent b6a1562 commit f180a23bf2a8ea53326cf2cd2856fcf3f0f7ff1d @tea tea committed Apr 8, 2009
Showing with 86 additions and 70 deletions.
  1. +1 −0 .gitignore
  2. +2 −1 ecore/DataText.h
  3. +1 −3 src/LineListNoWrap.cpp
  4. +2 −4 src/LineListWrap.cpp
  5. +20 −4 src/Makefile
  6. +1 −1 src/commit.xpm
  7. +1 −1 src/document.xpm
  8. +1 −1 src/e.xpm
  9. +4 −4 src/ftpparse.cpp
  10. +1 −1 src/images/NewDocument.xpm
  11. +1 −1 src/images/NewFolder.xpm
  12. +1 −1 src/images/accept.xpm
  13. +1 −1 src/images/close.xpm
  14. +1 −1 src/images/close_disabled.xpm
  15. +1 −1 src/images/close_down.xpm
  16. +1 −1 src/images/close_hot.xpm
  17. +1 −1 src/images/empty.xpm
  18. +1 −1 src/images/exclamation.xpm
  19. +1 −1 src/images/incomming.xpm
  20. +1 −1 src/images/incomming_full.xpm
  21. +1 −1 src/images/left_arrow.xpm
  22. +1 −1 src/images/left_arrow_click.xpm
  23. +1 −1 src/images/left_arrow_gray.xpm
  24. +1 −1 src/images/left_arrow_over.xpm
  25. +1 −1 src/images/pin1.xpm
  26. +1 −1 src/images/pin1_over.xpm
  27. +1 −1 src/images/pin2.xpm
  28. +1 −1 src/images/pin2_over.xpm
  29. +1 −1 src/images/right_arrow.xpm
  30. +1 −1 src/images/right_arrow_click.xpm
  31. +1 −1 src/images/right_arrow_gray.xpm
  32. +1 −1 src/images/search.xpm
  33. +1 −1 src/images/search_re.xpm
  34. +1 −1 src/images/share.xpm
  35. +1 −1 src/images/tmBundle.xpm
  36. +1 −1 src/images/tmCommand.xpm
  37. +1 −1 src/images/tmLanguage.xpm
  38. +1 −1 src/images/tmPrefs.xpm
  39. +1 −1 src/images/tmSeparator.xpm
  40. +1 −1 src/images/tmSnippet.xpm
  41. +1 −1 src/images/tmSubMenu.xpm
  42. +1 −1 src/images/tmUnknown.xpm
  43. +1 −1 src/images/vtree_doc.xpm
  44. +1 −1 src/images/vtree_doc_pending.xpm
  45. +1 −1 src/images/vtree_draft.xpm
  46. +1 −1 src/images/vtree_draft_selected.xpm
  47. +1 −1 src/images/vtree_overlay_mirrored.xpm
  48. +1 −1 src/images/vtree_overlay_selected.xpm
  49. +1 −1 src/images/vtree_overlay_unread.xpm
  50. +6 −4 src/jsonval.cpp
  51. +1 −1 src/new.xpm
  52. +1 −1 src/open.xpm
  53. +1 −1 src/retrieve.xpm
  54. +1 −1 src/save.xpm
  55. +1 −1 src/search.xpm
  56. +1 −1 src/search_re.xpm
  57. +1 −1 src/x.xpm
View
1 .gitignore
@@ -22,6 +22,7 @@ _ReSharper*
# Linux stuff
*.o
+*.d
## Ignore most things in external, except what we permit below
View
3 ecore/DataText.h
@@ -84,4 +84,5 @@ class DataText {
cDataText* m_dt;
};
-#endif // __CDATATEXT_H__
+#endif // __CDATATEXT_H__
+
View
4 src/LineListNoWrap.cpp
@@ -272,9 +272,7 @@ void LineListNoWrap::Print() {
wxLogDebug(wxT(" height: %u"), height());
for (unsigned int i = 0; i < size(); ++i) {
- const unsigned int offset = m_textOffsets[i];
- const unsigned int lineWidth = m_lineWidths[i];
- wxLogDebug(wxT(" %u: %u %u"), i, offset, lineWidth);
+ wxLogDebug(wxT(" %u: %u %u"), i, m_textOffsets[i], m_lineWidths[i]);
}
}
View
6 src/LineListWrap.cpp
@@ -673,12 +673,10 @@ void LineListWrap::Print() {
wxLogDebug(wxT(" height: %u"), height());
unsigned int h = height();
if (lastLoadedPos == 0) wxLogDebug(wxT(" _linelist: %d-%d"), firstLoadedPos, lastLoadedPos);
- else wxLogDebug(wxT(" linelist: %d %d (%d-%d -> %d-%d) %u"), lastValidOffset, lastValidPos, firstLoadedPos, lastLoadedPos, approxTop, yPositions[lastLoadedPos-1], h);
+ else wxLogDebug(wxT(" linelist: %d %d (%d-%d -> %d-%d) %u"), lastValidOffset, lastValidPos, firstLoadedPos, lastLoadedPos, approxTop, yPositions[lastLoadedPos-1], height());
for (unsigned int i = 0; i < size(); ++i) {
- unsigned int offset = textOffsets[i];
- unsigned int position = yPositions[i];
- wxLogDebug(wxT(" %u: %u %u"), i, offset, position);
+ wxLogDebug(wxT(" %u: %u %u"), i, textOffsets[i], yPositions[i]);
}
}
View
24 src/Makefile
@@ -1,29 +1,45 @@
+VERBOSE=0
ECORE=ecore
+
+ifeq ($(VERBOSE),0)
+ ECHO=echo
+ SILENT=@
+else
+ ECHO=true
+ SILENT=
+endif
+
WXINCLUDES = $(shell ../external/out/bin/wx-config --cppflags)
WXLIBS = $(shell ../external/out/bin/wx-config --libs)
GTKINCLUDES = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/atk-1.0
LIBINCLUDES = -I../external/out/include -I../external/out/usr/include -I/usr/include/out/include/curl -I../external/tinyxml -I../external/pcre -I../external/libtomcrypt -I../external/libtommath
INCLUDES = $(WXINCLUDES) $(GTKINCLUDES) $(LIBINCLUDES) -I../ecore -I.
-CMPOPTS = -Wno-write-strings -DHAVE_CONFIG_H -O2
+CMPOPTS = -Wall -fno-strict-aliasing -DHAVE_CONFIG_H -O2
EXCEPT = CygwinDlg.cpp ExceptionHandler.cpp ExceptionAttacher.cpp GetWinVer.cpp IEHtmlWin.cpp MiniVersion.cpp MozillaHtmlWnd.cpp ShellContextMenu.cpp wxactivex.cpp
SRCS = $(filter-out $(EXCEPT), $(wildcard *.cpp))
OBJS = $(SRCS:.cpp=.o)
+DEPS = $(OBJS:.o=.d)
LOPTS = $(WXLIBS) -lpcre -lcurl -ltomcrypt -ltommath -lmk4
CPP = g++
EXE = e
+.PHONY: all clean
+
all: $(EXE)
$(EXE): $(OBJS)
- $(CPP) -o $(EXE) $(OBJS) -L../ecore -l$(ECORE) $(LOPTS) $(shell ../external/out/bin/wx-config --linkdeps) ../external/tinyxml/tinystr.o ../external/tinyxml/tinyxmlerror.o ../external/tinyxml/tinyxml.o ../external/tinyxml/tinyxmlparser.o
+ @$(ECHO) "LD $@"
+ $(SILENT)$(CPP) -o $(EXE) $(OBJS) -L../ecore -l$(ECORE) $(LOPTS) $(shell ../external/out/bin/wx-config --linkdeps) ../external/tinyxml/tinystr.o ../external/tinyxml/tinyxmlerror.o ../external/tinyxml/tinyxml.o ../external/tinyxml/tinyxmlparser.o
%.o: %.cpp
- $(CPP) $(INCLUDES) $(CMPOPTS) -c -o $@ $<
+ @$(ECHO) "CC $<"
+ $(SILENT)$(CPP) $(INCLUDES) $(CMPOPTS) -MD -c -o $@ $<
clean:
- rm -f $(OBJS) $(EXE)
+ rm -f $(OBJS) $(EXE) $(DEPS)
+-include $(DEPS)
View
2 src/commit.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * commit_xpm[] = {
+static const char * commit_xpm[] = {
"32 32 233 2",
" c None",
"! c black",
View
2 src/document.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * document_xpm[] = {
+static const char * document_xpm[] = {
"16 16 45 1",
" c None",
"! c black",
View
2 src/e.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * e_xpm[] = {
+static const char * e_xpm[] = {
"116 98 241 2",
" c None",
"! c black",
View
8 src/ftpparse.cpp
@@ -112,19 +112,19 @@ static long guesstai(long month,long mday)
}
}
-static int check(char *buf,char *monthname)
+static int check(const char *buf,const char *monthname)
{
if ((buf[0] != monthname[0]) && (buf[0] != monthname[0] - 32)) return 0;
if ((buf[1] != monthname[1]) && (buf[1] != monthname[1] - 32)) return 0;
if ((buf[2] != monthname[2]) && (buf[2] != monthname[2] - 32)) return 0;
return 1;
}
-static char *months[12] = {
+static const char *months[12] = {
"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"
} ;
-static int getmonth(char *buf,int len)
+static int getmonth(const char *buf,int len)
{
int i;
if (len == 3)
@@ -133,7 +133,7 @@ static int getmonth(char *buf,int len)
return -1;
}
-static long getlong(char *buf,int len)
+static long getlong(const char *buf,int len)
{
long u = 0;
while (len-- > 0)
View
2 src/images/NewDocument.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * newdocument_xpm[] = {
+static const char * newdocument_xpm[] = {
"16 16 80 1",
" c None",
"! c black",
View
2 src/images/NewFolder.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * newfolder_xpm[] = {
+static const char * newfolder_xpm[] = {
"16 16 154 2",
" c None",
"! c black",
View
2 src/images/accept.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * accept_xpm[] = {
+static const char * accept_xpm[] = {
"16 16 144 2",
" c None",
"! c black",
View
2 src/images/close.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * close_xpm[] = {
+static const char * close_xpm[] = {
"14 14 138 2",
" c None",
"! c black",
View
2 src/images/close_disabled.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * close_disabled_xpm[] = {
+static const char * close_disabled_xpm[] = {
"14 14 131 2",
" c None",
"! c black",
View
2 src/images/close_down.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * close_down_xpm[] = {
+static const char * close_down_xpm[] = {
"14 14 137 2",
" c None",
"! c black",
View
2 src/images/close_hot.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * close_hot_xpm[] = {
+static const char * close_hot_xpm[] = {
"14 14 134 2",
" c None",
"! c black",
View
2 src/images/empty.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * empty_xpm[] = {
+static const char * empty_xpm[] = {
"16 16 2 1",
" c None",
"! c black",
View
2 src/images/exclamation.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * exclamation_xpm[] = {
+static const char * exclamation_xpm[] = {
"16 16 114 2",
" c None",
"! c black",
View
2 src/images/incomming.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * incomming_xpm[] = {
+static const char * incomming_xpm[] = {
"32 32 172 2",
" c None",
"! c black",
View
2 src/images/incomming_full.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * incomming_full_xpm[] = {
+static const char * incomming_full_xpm[] = {
"32 32 141 2",
" c None",
"! c black",
View
2 src/images/left_arrow.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * left_arrow_xpm[] = {
+static const char * left_arrow_xpm[] = {
"20 20 126 2",
" c None",
"! c black",
View
2 src/images/left_arrow_click.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * left_arrow_click_xpm[] = {
+static const char * left_arrow_click_xpm[] = {
"20 20 128 2",
" c None",
"! c black",
View
2 src/images/left_arrow_gray.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * left_arrow_gray_xpm[] = {
+static const char * left_arrow_gray_xpm[] = {
"20 20 75 1",
" c None",
"! c black",
View
2 src/images/left_arrow_over.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * left_arrow_over_xpm[] = {
+static const char * left_arrow_over_xpm[] = {
"20 20 128 2",
" c None",
"! c black",
View
2 src/images/pin1.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * pin1_xpm[] = {
+static const char * pin1_xpm[] = {
"20 13 22 1",
" c None",
"! c black",
View
2 src/images/pin1_over.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * pin1_over_xpm[] = {
+static const char * pin1_over_xpm[] = {
"20 13 21 1",
" c None",
"! c black",
View
2 src/images/pin2.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * pin2_xpm[] = {
+static const char * pin2_xpm[] = {
"20 20 19 1",
" c None",
"! c black",
View
2 src/images/pin2_over.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * pin2_over_xpm[] = {
+static const char * pin2_over_xpm[] = {
"20 20 19 1",
" c None",
"! c black",
View
2 src/images/right_arrow.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * right_arrow_xpm[] = {
+static const char * right_arrow_xpm[] = {
"20 20 143 2",
" c None",
"! c black",
View
2 src/images/right_arrow_click.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * right_arrow_click_xpm[] = {
+static const char * right_arrow_click_xpm[] = {
"20 20 144 2",
" c None",
"! c black",
View
2 src/images/right_arrow_gray.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * right_arrow_gray_xpm[] = {
+static const char * right_arrow_gray_xpm[] = {
"20 20 90 1",
" c None",
"! c black",
View
2 src/images/search.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * search_xpm[] = {
+static const char * search_xpm[] = {
"18 12 75 1",
" c None",
"! c black",
View
2 src/images/search_re.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * search_re_xpm[] = {
+static const char * search_re_xpm[] = {
"18 12 100 2",
" c None",
"! c black",
View
2 src/images/share.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * share_xpm[] = {
+static const char * share_xpm[] = {
"32 32 417 2",
" c None",
"! c black",
View
2 src/images/tmBundle.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * tmbundle_xpm[] = {
+static const char * tmbundle_xpm[] = {
"16 16 159 2",
" c None",
"! c #FEFEFE",
View
2 src/images/tmCommand.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * tmcommand_xpm[] = {
+static const char * tmcommand_xpm[] = {
"16 16 84 1",
" c None",
"! c black",
View
2 src/images/tmLanguage.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * tmlanguage_xpm[] = {
+static const char * tmlanguage_xpm[] = {
"16 16 38 1",
" c None",
"! c black",
View
2 src/images/tmPrefs.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * tmprefs_xpm[] = {
+static const char * tmprefs_xpm[] = {
"16 16 46 1",
" c None",
"! c black",
View
2 src/images/tmSeparator.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * tmseparator_xpm[] = {
+static const char * tmseparator_xpm[] = {
"16 16 3 1",
" c None",
"! c black",
View
2 src/images/tmSnippet.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * tmsnippet_xpm[] = {
+static const char * tmsnippet_xpm[] = {
"16 16 85 1",
" c None",
"! c black",
View
2 src/images/tmSubMenu.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * tmsubmenu_xpm[] = {
+static const char * tmsubmenu_xpm[] = {
"16 16 3 1",
" c None",
"! c black",
View
2 src/images/tmUnknown.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * tmunknown_xpm[] = {
+static const char * tmunknown_xpm[] = {
"16 16 22 1",
" c None",
"! c black",
View
2 src/images/vtree_doc.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vtree_doc_xpm[] = {
+static const char * vtree_doc_xpm[] = {
"10 10 3 1",
" c None",
"! c black",
View
2 src/images/vtree_doc_pending.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vtree_doc_pending_xpm[] = {
+static const char * vtree_doc_pending_xpm[] = {
"10 10 3 1",
" c None",
"! c black",
View
2 src/images/vtree_draft.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vtree_draft_xpm[] = {
+static const char * vtree_draft_xpm[] = {
"10 10 3 1",
" c None",
"! c black",
View
2 src/images/vtree_draft_selected.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vtree_draft_selected_xpm[] = {
+static const char * vtree_draft_selected_xpm[] = {
"10 10 3 1",
" c None",
"! c black",
View
2 src/images/vtree_overlay_mirrored.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vtree_overlay_mirrored_xpm[] = {
+static const char * vtree_overlay_mirrored_xpm[] = {
"10 10 3 1",
" c None",
"! c black",
View
2 src/images/vtree_overlay_selected.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vtree_overlay_selected_xpm[] = {
+static const char * vtree_overlay_selected_xpm[] = {
"10 10 3 1",
" c None",
"! c black",
View
2 src/images/vtree_overlay_unread.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * vtree_overlay_unread_xpm[] = {
+static const char * vtree_overlay_unread_xpm[] = {
"10 10 3 1",
" c None",
"! c black",
View
10 src/jsonval.cpp
@@ -528,17 +528,18 @@ wxJSONValue::IsObject() const
int
wxJSONValue::AsInt() const
{
- wxJSONRefData* data = GetRefData();
- wxASSERT( data );
int i;
// on 64-bits platforms check if the value fits in 32-bits
#if defined( wxJSON_64BIT_INT )
wxInt32 i32;
+ wxASSERT( GetRefData() );
bool success = AsInt32( &i32 );
wxASSERT( success );
i = (int) i32;
#else
+ wxJSONRefData* data = GetRefData();
+ wxASSERT( data );
switch ( data->m_type ) {
case wxJSONTYPE_BOOL :
i = (int) data->m_value.m_valBool;
@@ -719,15 +720,16 @@ unsigned int
wxJSONValue::AsUInt() const
{
unsigned int ui;
- wxJSONRefData* data = GetRefData();
- wxASSERT( data );
#if defined( wxJSON_64BIT_INT )
+ wxASSERT( GetRefData() );
wxUint32 ui32;
bool success = AsUInt32( &ui32 );
wxASSERT( success );
ui = (unsigned int) ui32;
#else
+ wxJSONRefData* data = GetRefData();
+ wxASSERT( data );
ui = data->m_value.m_valUInt;
switch ( data->m_type ) {
case wxJSONTYPE_BOOL :
View
2 src/new.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * new_xpm[] = {
+static const char * new_xpm[] = {
"32 32 91 1",
" c None",
"! c black",
View
2 src/open.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * open_xpm[] = {
+static const char * open_xpm[] = {
"32 32 319 2",
" c None",
"! c black",
View
2 src/retrieve.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * retrieve_xpm[] = {
+static const char * retrieve_xpm[] = {
"32 32 396 2",
" c None",
"! c black",
View
2 src/save.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * save_xpm[] = {
+static const char * save_xpm[] = {
"32 25 203 2",
" c None",
"! c black",
View
2 src/search.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * search_xpm[] = {
+static const char * search_xpm[] = {
"18 12 4 1",
" c None",
"! c black",
View
2 src/search_re.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * search_re_xpm[] = {
+static const char * search_re_xpm[] = {
"18 12 2 1",
" c None",
"! c black",
View
2 src/x.xpm
@@ -1,5 +1,5 @@
/* XPM */
-static char * x_xpm[] = {
+static const char * x_xpm[] = {
"8 7 2 1",
" c None",
"x c #000000",

0 comments on commit f180a23

Please sign in to comment.