From 75da71853046a6780066cd46b0632b34e131df64 Mon Sep 17 00:00:00 2001 From: "DONGBUM, KIM" Date: Mon, 30 Sep 2019 16:01:15 +0900 Subject: [PATCH] #6 Delete make_gcc directory --- make_gcc/makefile | 152 ------------------------------------- make_gcc/py/Compile.py | 37 --------- make_gcc/py/CompileImpl.py | 52 ------------- make_gcc/py/CompileLast.py | 62 --------------- make_gcc/py/CompileList | 0 5 files changed, 303 deletions(-) delete mode 100644 make_gcc/makefile delete mode 100644 make_gcc/py/Compile.py delete mode 100644 make_gcc/py/CompileImpl.py delete mode 100644 make_gcc/py/CompileLast.py delete mode 100644 make_gcc/py/CompileList diff --git a/make_gcc/makefile b/make_gcc/makefile deleted file mode 100644 index 53144ca..0000000 --- a/make_gcc/makefile +++ /dev/null @@ -1,152 +0,0 @@ -# START USER DEFINE AREA -# You can edit this area. - -# [User modify Data] - -# Library Path Define -# -# BOOST_INCLUDE / BOOST_LIB -# -# Set variables in /etc/profile or .bash_profile. -# - -INCLUDE = -I$(BOOST_INCLUDE) \ - -I$(MYSQL_INCLUDE) \ - -I$(MYSQL_DRIVER_INCLUDE) - -LIB = -lboost_thread \ - -lboost_system \ - -lboost_chrono \ - -lboost_filesystem \ - -lboost_regex \ - -lboost_date_time \ - -lboost_locale \ - -ldl \ - -lpthread \ - -lodbc\ - -lz \ - -L$(BOOST_LIB) - -# [User modify Data] End - -CFLAGS = -O2 -Wno-write-strings -Wno-deprecated -Wno-attributes -Wno-int-to-pointer-cast -std=c++11 -LFLAGS = -g -Wall -ggdb -#-g -Wall -ggdb - -OBJ_FILES = `ls *.o` - -TARGET_FILE = DServer - -MAKE_PATH = `pwd` -COMPILELISTPATH = $(MAKE_PATH)/py/CompileList -LASTCOMPILELISTPATH = $(MAKE_PATH)/py/LastCompileList - -OBJ_DIR = x64 -MAKE_DIR = ../make_gcc - -JOB_COUNT=8 - -SINGLE_FILE = ../src/main.cpp -PROJECT_PATH=$(MAKE_PATH)/.. - -PY_COMPILELIST=python py/Compile.py $(PROJECT_PATH) $(MAKE_PATH)/$(TARGET_FILE) $(COMPILELISTPATH) -PY_LASTCOMPILELIST=python py/CompileLast.py $(PROJECT_PATH) $(MAKE_PATH)/$(TARGET_FILE) $(LASTCOMPILELISTPATH) - -# complie shell script repeat define - - -CHECK=echo -n stand by; \ - while true; do\ - path=$$(pwd); \ - cd ../; \ - pspath=$$(pwd); \ - cd $$path; \ - \ - if [ `ps -ef | grep $$pspath | grep cc1plus | grep -v grep | wc -l` -le 0 ];\ - then\ - sleep 1;\ - echo .; \ - break; \ - fi;\ - sleep 1; \ - echo -n .;\ - done; - -# complie shell script repeat define -OBJ_DIR_MAKE=if [ -d $(OBJ_DIR) ]; \ - then \ - echo $(OBJ_DIR) exist!;\ - else \ - mkdir $(OBJ_DIR);\ - fi; - -# complie shell script repeat define -COMPILE=Count=0;\ - while read filename;do\ - echo -e "\033[34m [$$((Count+1))]compiling... $$filename.cpp\033[0m";\ - if [ $$((Count % $(JOB_COUNT))) -lt $$(($(JOB_COUNT) - 1)) ]; then\ - g++ -c $$filename.cpp $(INCLUDE) $(CFLAGS) -o $$filename.o & \ - else \ - g++ -c $$filename.cpp $(INCLUDE) $(CFLAGS) -o $$filename.o; \ - fi;\ - Count=$$((Count+1)); - -# complie shell script repeat define -OBJ_MOVE=while read filename;do\ - mv $$filename.o $(MAKE_DIR)/$(OBJ_DIR); - - - -default: - @$(PY_LASTCOMPILELIST);\ - echo -e "\033[33mCompile List Python Exe :";\ - echo -e "$(PY_LASTCOMPILELIST) \033[0m";\ - echo -e "\033[35mJOB_COUNT = $(JOB_COUNT) \033[0m"; \ - $(MAKE) lastcompile; - $(MAKE) link; -all: - @$(PY_COMPILELIST);\ - echo -e "\033[33mCompile List Python Exe :";\ - echo -e "$(PY_COMPILELIST) \033[0m";\ - echo -e "\033[35mJOB_COUNT = $(JOB_COUNT) \033[0m"; \ - $(MAKE) clean; - $(MAKE) compile; - $(MAKE) link; -compile: - @ \ - $(OBJ_DIR_MAKE) \ - $(COMPILE)\ - done < $(COMPILELISTPATH); \ - \ - $(CHECK)\ - \ - $(OBJ_MOVE)\ - done < $(COMPILELISTPATH); \ - echo compile : $$(date +%Y-%m-%d_%H:%M:%S) >> compiletime; -lastcompile: - @ \ - $(OBJ_DIR_MAKE) \ - $(COMPILE)\ - done < $(LASTCOMPILELISTPATH); \ - \ - $(CHECK)\ - \ - $(OBJ_MOVE)\ - done < $(LASTCOMPILELISTPATH); - echo lastcompile : $$(date +%Y-%m-%d_%H:%M:%S) >> compiletime; -link: - @cd $(OBJ_DIR); \ - echo linking... $(TARGETFILE); \ - g++ $(OBJ_FILES) $(LFLAGS) $(LIB) -o ../$(TARGET_FILE); \ - -clean: - @echo cleaning...; - rm -f $(TARGET_FILE); - rm $(OBJ_DIR) -rf; - -single: - @echo compiling... $(SINGLE_FILE).cpp; \ - g++ -c $(SINGLE_FILE).cpp $(INCLUDE) $(CFLAGS) -o $(SINGLE_FILE).o; \ - mv $(SINGLE_FILE).o $(MAKE_DIR)/$(OBJ_DIR); \ - - diff --git a/make_gcc/py/Compile.py b/make_gcc/py/Compile.py deleted file mode 100644 index 2089a08..0000000 --- a/make_gcc/py/Compile.py +++ /dev/null @@ -1,37 +0,0 @@ -import os,CompileImpl,sys - -startpath = sys.argv[1] -CompileListPath = sys.argv[3] - -def LowPathAllFile(path) : - os.chdir(path) - pathdir = os.listdir(path) - for each_value in pathdir : - if os.path.isdir(each_value) : - LowPathAllFile( os.getcwd() + '/' + each_value) - else : - FileType = CompileImpl.IsCompileFile(each_value) - if FileType == CompileImpl.CppType : - CompileImpl.CompileFileWrite(CompileListPath, each_value[:-4]) - elif FileType == CompileImpl.HType : - if os.stat(os.getcwd() + '/' + each_value).st_mtime >= CompileImpl.getlastCompileTime(sys.argv[2]) : - CompileImpl.CompileHeaderFileInsertList(each_value) - else : - CompileImpl.CompileNonHeaderFileInsertList( os.getcwd() + '/' + each_value) - os.chdir("../") - - - - -f = open(CompileListPath, 'w') -f.close() - -if __name__ == "__main__" : - if len(sys.argv) <= 1 : - print('not argv data') - else : - LowPathAllFile(startpath + '/src') - - - - diff --git a/make_gcc/py/CompileImpl.py b/make_gcc/py/CompileImpl.py deleted file mode 100644 index d7da2e0..0000000 --- a/make_gcc/py/CompileImpl.py +++ /dev/null @@ -1,52 +0,0 @@ -import os, glob, time, re - -HeaderList = [] -NonHeaderList= [] - - -NoneType=0; -CppType=1; -HType=2 - -def getlastCompileTime(Exepath) : - if os.path.exists(Exepath) : - lastCompileTime=os.stat(Exepath).st_mtime - else : - lastCompileTime=0 - return lastCompileTime - -def IsCompileFile(filename) : - # .cpp file process - if filename[-4:] == '.cpp' : - return CppType - # .h file process - elif filename[-2:] == '.h' : - return HType - else : - return NoneType; - -def CompileFileWrite(filepath, filename) : - # File Write Job - f = open(filepath, 'a') - data = os.getcwd() + '/' + filename + '\n' - f.write(data) - f.close() - -def CompileHeaderFileInsertList(filename) : - HeaderList.append(filename.split('/')[-1]) - -def CompileNonHeaderFileInsertList(filepath) : - NonHeaderList.append(filepath) - -def FindIncludeHeader(HeaderList, filepath) : - for headerfile in HeaderList : - p = re.compile(headerfile, re.I | re.S) - f = open(filepath, 'r') - for buffer in f : - m = p.search(buffer) - if m: - #print("[%s] : [%s]"%(buffer, headerfile)) - return True - return False - - diff --git a/make_gcc/py/CompileLast.py b/make_gcc/py/CompileLast.py deleted file mode 100644 index 8a5c004..0000000 --- a/make_gcc/py/CompileLast.py +++ /dev/null @@ -1,62 +0,0 @@ -import os,CompileImpl,Compile,sys - -startpath = sys.argv[1] -LastCompileListPath = sys.argv[3] - - -# low path dependency -> modify filelist and headerlist -def DependencyFile(path) : - os.chdir(path) - pathdir = os.listdir(path) - for each_value in pathdir : - if os.path.isdir(each_value) : - DependencyFile( os.getcwd() + '/' + each_value) - else : - FileType = CompileImpl.IsCompileFile(each_value) - if FileType == CompileImpl.CppType : - # file Time Check - if os.stat(os.getcwd() + '/' + each_value).st_mtime >= CompileImpl.getlastCompileTime(sys.argv[2]) : - CompileImpl.CompileFileWrite(LastCompileListPath, each_value[:-4]) - elif CompileImpl.FindIncludeHeader(CompileImpl.HeaderList, os.getcwd() + '/' + each_value) : - CompileImpl.CompileFileWrite(LastCompileListPath, each_value[:-4]) - os.chdir("../") - -# low path modify header , non modify header file list make -def ModifyHeaderFile(path) : - os.chdir(path) - pathdir = os.listdir(path) - for each_value in pathdir : - if os.path.isdir(each_value) : - ModifyHeaderFile( os.getcwd() + '/' + each_value) - else : - FileType = CompileImpl.IsCompileFile(each_value) - if FileType == CompileImpl.HType : - if os.stat(os.getcwd() + '/' + each_value).st_mtime >= CompileImpl.getlastCompileTime(sys.argv[2]) : - CompileImpl.CompileHeaderFileInsertList(each_value) - else : - CompileImpl.CompileNonHeaderFileInsertList( os.getcwd() + '/' + each_value) - os.chdir("../") - -#header -> header include process -def DependencyHeader() : - CompileImpl.NonHeaderList = list(set(CompileImpl.NonHeaderList)) - for each_value in CompileImpl.NonHeaderList : - if CompileImpl.FindIncludeHeader(CompileImpl.HeaderList, each_value) : - CompileImpl.CompileHeaderFileInsertList(each_value) - - CompileImpl.HeaderList = list(set(CompileImpl.HeaderList)) - -print(LastCompileListPath) -f = open(LastCompileListPath, 'w') -f.close() - -if __name__ == "__main__" : - if len(sys.argv) <= 1 : - print('can not argv data') - else : - ModifyHeaderFile(startpath) - DependencyHeader() - DependencyFile(startpath) - print ('SeachCompileFile Start') - - diff --git a/make_gcc/py/CompileList b/make_gcc/py/CompileList deleted file mode 100644 index e69de29..0000000