APP_NAME=ldc2
-APP_OBJECTS= main.o silent_code.o
-
-APP_OBJECTS+= tape_block.o eot_block.o discard_block.o\
+APP_OBJECTS= main.o silent_code.o argument_reader.o
+CCFLAGS+=-Wall
+BLOCK_OBJECTS=data_block_0_10.o data_block_0_14.o data_block_0_1.o data_block_0_24.o\
+ data_block_0_2.o data_block_0_30.o data_block_0_3.o data_block_0_4.o\
+ data_block_0_50.o data_block_0_54.o data_block_0_60.o data_block_0_44.o\
+ data_block_0_64.o tape_block.o eot_block.o discard_block.o\
data_block.o data_block_0.o data_block_0_0.o\
- data_block_0_label_extractor.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 \
+
-APP_OBJECTS+= data_block_0_10.o data_block_0_14.o data_block_0_1.o data_block_0_24.o\
- data_block_0_2.o data_block_0_30.o data_block_0_3.o data_block_0_4.o\
- data_block_0_50.o data_block_0_54.o data_block_0_60.o data_block_0_44.o
+APP_OBJECTS+=$(BLOCK_OBJECTS)
SRC_DIR=src
default: $(APP_NAME)
-#All objects depend on all headers. simple but works
-*.o: $(SRC_DIR)/*.hh
+APP_SOURCES=$(foreach obj, $(APP_OBJECTS:.o=.cpp),$(SRC_DIR)/$(obj))
+
+##All objects depend on all headers. simple but works
+#*.o: $(SRC_DIR)/*.hh
+
+%.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;}' > $@
+
-%.o : $(SRC_DIR)/%.cpp
- g++ -c -o$@ $<
+%.o : $(SRC_DIR)/%.cpp %.dep
+ g++ -c $(CCFLAGS) -o $@ $<
$(APP_NAME) : $(APP_OBJECTS)
- g++ -o$@ $^
+ @g++ -o$@ $^
+
+saustall: $(APP_OBJECTS:.o=.dep)
clean:
- rm -rf $(APP_NAME) *.o doxy/ $(SRC_DIR)/*~ ul_timestamp
- $(MAKE) -C doc clean
+ @rm -rf $(APP_NAME) *.o doxy/ $(SRC_DIR)/*~ ul_timestamp *.dep
+ @$(MAKE) -C doc clean
-doxy/timestamp: $(SRC_DIR)/*
+doxy/timestamp: $(APP_OBJECTS)
@ if [ ! -d doxy ]; then mkdir doxy; fi
@doxygen Doxyfile
touch $@
all: $(APP_NAME) doxy doc
.PHONY: all clean doxy upload docdata_block_0_0.o
+
+.PRECIOUS: *.dep
+
+#$(APP_OBJECTS:.o=.d)
+
+include $(wildcard *.dep)
cat ps.gnu $< | gnuplot > $@
clean:
- rm -f *.dvi *.ps *.pdf *.toc *~ *.log *.aux *.bbl *.blg *.lof *.lot
+ @rm -f *.dvi *.ps *.pdf *.toc *~ *.log *.aux *.bbl *.blg *.lof *.lot
vector<string> data_block_0_0::get_description(){
vector<string> result;
vector<string> labels=get_labels();
- for (int i=0; i<labels.size();i++){
+ for (unsigned int i=0; i<labels.size();i++){
if (i==0) result.insert(result.end(),
labels[i]+" "+get_typestring()+"Subprogram Name");
else
vector<string> data_block_0_50::get_description(){
vector<string> result;
vector<string> labels=get_labels();
- for (int i=0; i<labels.size();i++){
+ for (unsigned int i=0; i<labels.size();i++){
if (i==0) result.insert(result.end(),
labels[i]+" "+get_typestring()+"Subprogram Entry Point Definition");
else
#include "tape_block.hh"
#include "data_block.hh"
-#include "argread.hh"
+#include "argument_reader.hh"
using namespace std;
string name="Philipp";
string filename;
- argreader ar("ldc2");
+ argument_reader ar("ldc2");
ar.add_param("h","help","Give help",&help_needed);
ar.add_param("n","name=","Enter other name",&name_set,&name,"<name>");
ar.add_param("n","name=","Enter other name",&name_set,&name,"<name>");
ar.add_param("n","name=","Enter other name",&name_set,&name,"<name>");
ar.add_param("n","name=","Enter other name",&name_set,&name,"<name>");
ar.add_param("n","name=","Enter other name",&name_set,&name,"<name>");
- ar.add_free_param("<input-blaaaaaaaaaaaaaaa-filename>","File to read data from",&file_set,&filename);
+ ar.add_argument("<input-blaaaaaaaaaaaaaaa-filename>","File to read data from",&file_set,&filename);
dump_vector(ar.read_args(argc,args));