ldc2: Cosmetic fixes and support for compiler orverride
authorPhilipp Hachtmann <hachti@hachti.de>
Tue, 17 May 2016 12:10:06 +0000 (14:10 +0200)
committerPhilipp Hachtmann <hachti@hachti.de>
Tue, 17 May 2016 12:10:06 +0000 (14:10 +0200)
Signed-off-by: Philipp Hachtmann <hachti@hachti.de>
pc-tools/ldc2/Makefile
pc-tools/ldc2/src/main.cpp

index a2b218c3d3cad63df6513b3958e1b442b88cf69d..4682d17aaea2c3794cee95a701ee0946775a7130 100644 (file)
@@ -2,11 +2,12 @@ APP_NAME=ldc2
 APP_OBJECTS= main.o  silent_code.o configuration_manager.o tool.o config.o
 CCFLAGS+=-Wall
 
-
 BUILD_STAMP="\"`uname -a`\""
 VERSION="\"1.0\""
 BUILD_DATE="\"`date` \""
 
+CXX?=g++
+
 CCFLAGS+=-D BUILD_STAMP=$(BUILD_STAMP) -D VERSION=$(VERSION) -D BUILD_DATE=$(BUILD_DATE)
 
 BLOCK_OBJECTS=tape_block.o eot_block.o data_block.o broken_block.o\
@@ -18,7 +19,6 @@ BLOCK_OBJECTS=tape_block.o eot_block.o data_block.o broken_block.o\
               data_block_0_label_extractor.o data_block_1.o data_block_2.o\
               data_block_3.o data_block_4.o data_block_5.o \
               data_block_6.o data_block_7.o
-              
 
 OBJECTS=$(BLOCK_OBJECTS) $(APP_OBJECTS)
 
@@ -35,14 +35,13 @@ APP_SOURCES=$(foreach obj, $(OBJECTS:.o=.cpp),$(SRC_DIR)/$(obj))
 
 %.dep : $(SRC_DIR)/%.cpp
        @ echo Building dependencies for $<.
-       @$(SHELL) -c  "g++ -M $<" | awk 'BEGIN {N=0}{if(N==0)printf("%s %s\n","$@",$$0);else printf("%s\n", $$0);N+=1;}' >  $@
-       
+       @$(SHELL) -c  "$(CXX) -M $<" | awk 'BEGIN {N=0}{if(N==0)printf("%s %s\n","$@",$$0);else printf("%s\n", $$0);N+=1;}' >  $@
 
 %.o : $(SRC_DIR)/%.cpp %.dep
-       g++ -c $(CCFLAGS) -o $@ $<
+       $(CXX) -c $(CCFLAGS) -o $@ $<
 
 $(APP_NAME) : $(OBJECTS)
-       g++    -o$@ $^
+       $(CXX)    -o$@ $^
 
 saustall: $(OBJECTS:.o=.dep)
 
index a8d0a4a36165ebdd5bda77b1c73b838ee771b302..8b7da8788adc4e0753701545b23467a48f19bcd1 100644 (file)
@@ -116,8 +116,8 @@ void read_tape(){
   
   while(read_ahead){
 
-    bool err_checksum=false;  //! Checksum error flag.
-    bool err_integrity=false; //! Integrity error flag.
+         //  bool err_checksum=false;  //! Checksum error flag.
+         //    bool err_integrity=false; //! Integrity error flag.
     
     bool warning=false;       //! Warning flag.
     bool error=false;         //! Error flag.
@@ -146,7 +146,7 @@ void read_tape(){
     
     catch(tape_block::eof_illegal_exception &e){
       block=e.get_block();
-      err_integrity=true;
+      //      err_integrity=true;
       read_ahead=false;
       if (cfg_ignore_block_errors){
        message="Warning: Block integrity check failed!\n";
@@ -160,7 +160,7 @@ void read_tape(){
     
     catch(tape_block::checksum_error_exception &e){
       block=e.get_block();
-      err_checksum=true;
+      //      err_checksum=true;
       if (cfg_ignore_checksum_errors){
        message="Warning: Block checksum wrong!\n";
        warning=true;