all : $(BIN)
-$(BIN) : $(LINKOBJ)
+tests/% : tests/%.cpp ../obj/tests/%.o $(LINKOBJ)
+
+runtests : tests/runtests.sh
+ cd tests; ./runtests.sh
+
+
- $(BIN) : $(LINKOBJ)
++$(BIN) : $(LINKOBJ) ../obj/$(MAIN)
@mkdir -p $(dir $@)
- $(CXX) -o $(BIN) $(LINKOBJ) $(LIB)
+ $(CXX) -o $(BIN) $(LINKOBJ) ../obj/$(MAIN) $(LIB)
../obj/%.o : %.cpp
@mkdir -p $(dir $@)
-include $(DEPS)
+clean_bin :
+ $(RM) $(BIN)
+
clean :
-- $(RM) $(BIN) $(DEPS) $(LINKOBJ)
++ $(RM) $(BIN) $(DEPS) $(LINKOBJ) ../obj/$(MAIN)
+ $(RM) tests/*~
+ $(RM) tests/*.test
+ $(RM) tests/*.out
+ $(RM) tests/*.err
+
-clean_full: #cleans up all backup files
- $(RM) $(BIN) $(DEPS) $(LINKOBJ)
+clean_full: clean
$(RM) *.*~
$(RM) *~
- $(RM) *.o
+
-#include "common.h"
-
-#include "document.h"
-#include "view.h"
-#include "screen.h"
-
-using namespace std;
-using namespace IPDF;
-
+#include "main.h"
+#include <unistd.h> // Because we can.
int main(int argc, char ** argv)
-{
+{
Document doc;
- doc.Add(RECT_FILLED, Rect(Random(), Random(), Random(), Random()));
-
- View view(doc);
-
- Screen scr;
-
- while (scr.PumpEvents())
+ srand(time(NULL));
+ if (argc > 1)
{
- view.Render();
- scr.Present();
+ for (int i = 2; i < argc; ++i)
+ {
+ if (fork() == 0) doc.Load(argv[i]);
+ }
+ doc.Load(argv[1]);
}
-
++ else
++ {
++ Debug("Add random object");
++ doc.Add(RECT_FILLED, Rect(Random()*0.5, Random()*0.5, Random()*0.5, Random()*0.5));
++ }
+ MainLoop(doc);
return 0;
}