Fix compiling in Linux. Fix compiling dmake.
This commit is contained in:
parent
9b16fd7be4
commit
a7996ab252
10
Makefile
10
Makefile
|
@ -24,6 +24,8 @@ LIBOBJ = lib/checkautovariables.o \
|
||||||
lib/errorlogger.o \
|
lib/errorlogger.o \
|
||||||
lib/executionpath.o \
|
lib/executionpath.o \
|
||||||
lib/filelister.o \
|
lib/filelister.o \
|
||||||
|
lib/filelister_unix.o \
|
||||||
|
lib/filelister_win32.o \
|
||||||
lib/mathlib.o \
|
lib/mathlib.o \
|
||||||
lib/preprocessor.o \
|
lib/preprocessor.o \
|
||||||
lib/settings.o \
|
lib/settings.o \
|
||||||
|
@ -126,9 +128,15 @@ lib/errorlogger.o: lib/errorlogger.cpp lib/errorlogger.h lib/settings.h lib/toke
|
||||||
lib/executionpath.o: lib/executionpath.cpp lib/executionpath.h lib/token.h
|
lib/executionpath.o: lib/executionpath.cpp lib/executionpath.h lib/token.h
|
||||||
$(CXX) $(CXXFLAGS) -Ilib -c -o lib/executionpath.o lib/executionpath.cpp
|
$(CXX) $(CXXFLAGS) -Ilib -c -o lib/executionpath.o lib/executionpath.cpp
|
||||||
|
|
||||||
lib/filelister.o: lib/filelister.cpp lib/filelister.h
|
lib/filelister.o: lib/filelister.cpp lib/filelister.h lib/filelister_unix.h
|
||||||
$(CXX) $(CXXFLAGS) -Ilib -c -o lib/filelister.o lib/filelister.cpp
|
$(CXX) $(CXXFLAGS) -Ilib -c -o lib/filelister.o lib/filelister.cpp
|
||||||
|
|
||||||
|
lib/filelister_unix.o: lib/filelister_unix.cpp lib/filelister.h lib/filelister_unix.h
|
||||||
|
$(CXX) $(CXXFLAGS) -Ilib -c -o lib/filelister_unix.o lib/filelister_unix.cpp
|
||||||
|
|
||||||
|
lib/filelister_win32.o: lib/filelister_win32.cpp lib/filelister.h lib/filelister_win32.h
|
||||||
|
$(CXX) $(CXXFLAGS) -Ilib -c -o lib/filelister_win32.o lib/filelister_win32.cpp
|
||||||
|
|
||||||
lib/mathlib.o: lib/mathlib.cpp lib/mathlib.h lib/token.h
|
lib/mathlib.o: lib/mathlib.cpp lib/mathlib.h lib/token.h
|
||||||
$(CXX) $(CXXFLAGS) -Ilib -c -o lib/mathlib.o lib/mathlib.cpp
|
$(CXX) $(CXXFLAGS) -Ilib -c -o lib/mathlib.o lib/mathlib.cpp
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
////// This code is POSIX-style systems ///////////////////////////////////////
|
////// This code is POSIX-style systems ///////////////////////////////////////
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void FileLister::recursiveAddFiles(std::vector<std::string> &filenames, const std::string &path, bool recursive)
|
void FileListerUnix::recursiveAddFiles(std::vector<std::string> &filenames, const std::string &path, bool recursive)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << path;
|
oss << path;
|
||||||
|
@ -63,7 +63,7 @@ void FileLister::recursiveAddFiles(std::vector<std::string> &filenames, const st
|
||||||
else if (recursive)
|
else if (recursive)
|
||||||
{
|
{
|
||||||
// Directory
|
// Directory
|
||||||
FileLister::recursiveAddFiles(filenames, filename, recursive);
|
getFileLister()->recursiveAddFiles(filenames, filename, recursive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globfree(&glob_results);
|
globfree(&glob_results);
|
||||||
|
|
|
@ -83,7 +83,7 @@ static BOOL MyIsDirectory(std::string path)
|
||||||
return (GetFileAttributes(path.c_str()) & FILE_ATTRIBUTE_DIRECTORY);
|
return (GetFileAttributes(path.c_str()) & FILE_ATTRIBUTE_DIRECTORY);
|
||||||
#else
|
#else
|
||||||
// See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx
|
// See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx
|
||||||
return PathIsDirectory(path.c_str());
|
return PathIsDirectory(path.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
lib/lib.pri
12
lib/lib.pri
|
@ -15,16 +15,14 @@ HEADERS += $$PWD/check.h \
|
||||||
$$PWD/errorlogger.h \
|
$$PWD/errorlogger.h \
|
||||||
$$PWD/executionpath.h \
|
$$PWD/executionpath.h \
|
||||||
$$PWD/filelister.h \
|
$$PWD/filelister.h \
|
||||||
|
$$PWD/filelister_unix.h \
|
||||||
|
$$PWD/filelister_win32.h \
|
||||||
$$PWD/mathlib.h \
|
$$PWD/mathlib.h \
|
||||||
$$PWD/preprocessor.h \
|
$$PWD/preprocessor.h \
|
||||||
$$PWD/settings.h \
|
$$PWD/settings.h \
|
||||||
$$PWD/token.h \
|
$$PWD/token.h \
|
||||||
$$PWD/tokenize.h
|
$$PWD/tokenize.h
|
||||||
|
|
||||||
win32 {
|
|
||||||
HEADERS += $$PWD/filelister_win32.h
|
|
||||||
}
|
|
||||||
|
|
||||||
SOURCES += $$PWD/checkautovariables.cpp \
|
SOURCES += $$PWD/checkautovariables.cpp \
|
||||||
$$PWD/checkbufferoverrun.cpp \
|
$$PWD/checkbufferoverrun.cpp \
|
||||||
$$PWD/checkclass.cpp \
|
$$PWD/checkclass.cpp \
|
||||||
|
@ -39,12 +37,10 @@ SOURCES += $$PWD/checkautovariables.cpp \
|
||||||
$$PWD/errorlogger.cpp \
|
$$PWD/errorlogger.cpp \
|
||||||
$$PWD/executionpath.cpp \
|
$$PWD/executionpath.cpp \
|
||||||
$$PWD/filelister.cpp \
|
$$PWD/filelister.cpp \
|
||||||
|
$$PWD/filelister_unix.cpp \
|
||||||
|
$$PWD/filelister_win32.cpp \
|
||||||
$$PWD/mathlib.cpp \
|
$$PWD/mathlib.cpp \
|
||||||
$$PWD/preprocessor.cpp \
|
$$PWD/preprocessor.cpp \
|
||||||
$$PWD/settings.cpp \
|
$$PWD/settings.cpp \
|
||||||
$$PWD/token.cpp \
|
$$PWD/token.cpp \
|
||||||
$$PWD/tokenize.cpp
|
$$PWD/tokenize.cpp
|
||||||
|
|
||||||
win32 {
|
|
||||||
SOURCES += $$PWD/filelister_win32.cpp
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
|
|
||||||
all: errmsg dmake
|
|
||||||
|
|
||||||
errmsg: errmsg.cpp
|
|
||||||
g++ -Wall -pedantic -o errmsg errmsg.cpp
|
|
||||||
|
|
||||||
dmake: dmake.cpp
|
|
||||||
g++ -Wall -pedantic -o dmake dmake.cpp ../lib/filelister.cpp
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "../lib/filelister.h"
|
#include "../lib/filelister_unix.h"
|
||||||
|
|
||||||
std::string objfile(std::string cppfile)
|
std::string objfile(std::string cppfile)
|
||||||
{
|
{
|
||||||
|
@ -82,8 +82,8 @@ static void compilefiles(std::ostream &fout, const std::vector<std::string> &fil
|
||||||
|
|
||||||
static void getCppFiles(std::vector<std::string> &files, const std::string &path)
|
static void getCppFiles(std::vector<std::string> &files, const std::string &path)
|
||||||
{
|
{
|
||||||
FileLister::recursiveAddFiles(files, path, true);
|
FileListerUnix lister;
|
||||||
|
lister.recursiveAddFiles(files, path, true);
|
||||||
// only get *.cpp files..
|
// only get *.cpp files..
|
||||||
for (std::vector<std::string>::iterator it = files.begin(); it != files.end();)
|
for (std::vector<std::string>::iterator it = files.begin(); it != files.end();)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue