]> git.gag.com Git - fw/sdcc/commitdiff
* support/regression/Makefile: Improved clean
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 21 Oct 2001 20:53:04 +0000 (20:53 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 21 Oct 2001 20:53:04 +0000 (20:53 +0000)
* support/regression/ports/gbz80/spec.mk: Added clean
* support/regression/ports/host/spec.mk: Added clean
* support/regression/ports/z80/spec.mk: Added clean
* support/regression/ports/mcs51/spec.mk: Added clean, little improvements
* support/regression/ports/mcs51/timeout.c: little improvements

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1425 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
support/regression/Makefile
support/regression/ports/gbz80/spec.mk
support/regression/ports/host/spec.mk
support/regression/ports/mcs51/spec.mk
support/regression/ports/mcs51/timeout.c
support/regression/ports/z80/spec.mk

index 865e94e7320ff2fd647fe234b39145d25a536fbb..df6a9108f6e39656fea1ad1b497b2882409a5417 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2001-10-21  Bernhard Held  <bernhard@bernhardheld.de>
+
+       * support/regression/Makefile: Improved clean
+
+       * support/regression/ports/gbz80/spec.mk: Added clean
+
+       * support/regression/ports/host/spec.mk: Added clean
+
+       * support/regression/ports/z80/spec.mk: Added clean
+
+       * support/regression/ports/mcs51/spec.mk: Added clean, little improvements
+
+       * support/regression/ports/mcs51/timeout.c: little improvements
+
+
 2001-10-16  Bernhard Held  <bernhard@bernhardheld.de>
 
        * support/regression/port/mcs51/spec.mk: add timeout for uCsim
index 32e93fbf94e41216f3f4d627f168ff854f838428..92057a7ea8e61be2e389b0ef25dbee65f6a99908 100644 (file)
@@ -63,6 +63,9 @@ GENERATE_CASES = generate-cases.py
 # files and how to run the emulator.
 ALL_PORTS = $(filter-out CVS mcs51 gbz80,$(notdir $(wildcard $(PORTS_DIR)/*)))
 
+# These  ports will be cleaned with 'make clean'
+CLEAN_PORTS = $(filter-out CVS,$(notdir $(wildcard $(PORTS_DIR)/*)))                                                                 
+
 all: test-ports
 
 # Test all of the ports
@@ -179,8 +182,10 @@ $(RESULTS): $(SUB_RESULTS)
 
 # BeginGeneric rules
 
-clean:
+clean: inter-port-clean
        rm -rf $(CASES_DIR) $(RESULTS_DIR) *.pyc
+       for i in $(CLEAN_PORTS); do $(MAKE) -f $(PORTS_DIR)/$$i/spec.mk _clean PORT=$$i; done
 
 inter-port-clean:
-       rm -f  fwk/lib/*.o fwk/lib/*.asm fwk/lib/*.rst fwk/lib/*.lst fwk/lib/*.rel
+       rm -f  fwk/lib/*.o fwk/lib/*.asm fwk/lib/*.rst fwk/lib/*.lst fwk/lib/*.rel \
+               fwk/lib/*.ihx fwk/lib/*.map fwk/lib/*.sym                                                                                 
index d8b33ede2fc03cea874fd97dc23f0c6994d17d7d..4b9c5c58d75d8f780c8bb88d3c92109a77883a63 100644 (file)
@@ -28,3 +28,6 @@ EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
        $(EMU) -m $< > $@
        -grep -n FAIL $@ /dev/null || true
 
+_clean:
+       rm -f ports/$(PORT)/*.lst ports/$(PORT)/*.o ports/$(PORT)/*.sym
+
index 0e03a3f4cebbe8e5c6d42d1bc17af27a643c7efc..9471f7e94ce8b594df72dc9a2f39513ef2f5303d 100644 (file)
@@ -17,3 +17,7 @@ EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
 
 %$(OBJEXT): %.c fwk/include/*.h
        $(SDCC) $(SDCCFLAGS) -c $< -o $@
+
+_clean:
+       rm -f ports/$(PORT)/support.o
+
index 1c76314e3951983709024c90cd8480920ca3856f..071d08eeb27e930466eb304e50c31e0553351ff7 100644 (file)
@@ -11,7 +11,7 @@ EXEEXT = .ihx
 EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
 
 # Rule to link into .ihx
-%.ihx: %$(OBJEXT) $(EXTRAS)
+%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
        $(SDCC) $(SDCCFLAGS) $(EXTRAS) $<
        mv fwk/lib/testfwk.ihx $@
        mv fwk/lib/testfwk.map $(@:.ihx=.map)
@@ -22,7 +22,14 @@ EXTRAS = fwk/lib/testfwk$(OBJEXT) ports/$(PORT)/support$(OBJEXT)
 # run simulator with 5 seconds timeout
 %.out: %$(EXEEXT) ports/$(PORT)/timeout
        mkdir -p `dirname $@`
-       -ports/$(PORT)/timeout 5 $(S51) -t32 -S in=/dev/null,out=$@ $< < ports/mcs51/uCsim.cmd >/dev/null 2>&1 || \
+       -ports/$(PORT)/timeout 5 $(S51) -t32 -S in=/dev/null,out=$@ $< < ports/mcs51/uCsim.cmd >/dev/null || \
           echo -e --- FAIL: \"timeout, simulation killed\" in $(<:.ihx=.c)"\n"--- Summary: 1/1/1: timeout >> $@
        -grep -n FAIL $@ /dev/null || true
 
+ports/$(PORT)/timeout: ports/$(PORT)/timeout.c
+       gcc -o $@ $<
+
+_clean:
+       rm -f ports/$(PORT)/timeout ports/$(PORT)/*.rel ports/$(PORT)/*.rst ports/$(PORT)/*.lst \
+          ports/$(PORT)/*.sym ports/$(PORT)/*.asm
+
index 4b6b5e25153cb694bb0e17d723bb774b17a0a093..a768ffe562c8f7db2ab5af8c84183debf6f7ffa3 100644 (file)
@@ -66,14 +66,6 @@ sigchld_handler (int signum)
   int pid;
   int status;
   int exit_status = 0;
-  struct rlimit rl;
-
-  /* remove limitation for CPU time */
-  if (getrlimit (RLIMIT_CPU, &rl) == 0)
-    {
-      rl.rlim_cur = rl.rlim_max;
-      setrlimit (RLIMIT_CPU, &rl);
-    }
 
   while (1)
     {
@@ -93,6 +85,7 @@ main (int argc, char * const *argv)
 {
   /* if getrlimit() / setrlimit() succeed, then no fork is neeeded */
   int flagNoFork = 0;
+  int old_stderr;
   long timeout;
   pid_t pid_child;
   struct rlimit rl;
@@ -119,18 +112,48 @@ main (int argc, char * const *argv)
     }
 
   if (flagNoFork)
-    /* the CPU-time is limited: simple execvp */
-    return execvp (argv[2], argv + 2);
+    { /* the CPU-time is limited: simple execvp */
+
+      /* s51 prints warnings on stderr:                                  */
+      /* serial input/output interface connected to a non-terminal file. */
+      /* We'll redirect here stderr to stdout, which will be redirected  */
+      /* to /dev/null by the shell. The shell could also redirect stderr */
+      /* to /dev/null, but then this program doesn't have the chance to  */
+      /* output any real error. */
+      old_stderr = dup (STDERR_FILENO);
+      dup2 (STDOUT_FILENO, STDERR_FILENO);
+      /* shouldn't return */
+      execvp (argv[2], argv + 2);
+      /* restore stderr */
+      dup2 (old_stderr, STDERR_FILENO);
+      perror (argv[2]);
+      return 1; /* Error */
+    }
   else
     {
       /* do it the hard way: fork/exec */
       signal (SIGCHLD, sigchld_handler);
       pid_child = fork();
       if (pid_child == 0)
-        return execvp (argv[2], argv + 2);
+        {
+           /* s51 prints warnings on stderr:                                  */
+           /* serial input/output interface connected to a non-terminal file. */
+           /* We'll redirect here stderr to stdout, which will be redirected  */
+           /* to /dev/null by the shell. The shell could also redirect stderr */
+           /* to /dev/null, but then this program doesn't have the chance to  */
+           /* output any real error. */
+           old_stderr = dup (STDERR_FILENO);
+           dup2 (STDOUT_FILENO, STDERR_FILENO);
+           /* shouldn't return */
+           execvp (argv[2], argv + 2);
+           /* restore stderr */
+           dup2 (old_stderr, STDERR_FILENO);
+           perror (argv[2]);
+           return 1; /* Error */
+        }
       else
         {
-         /* this timeout is hopefully aborted by a SIGCHLD */
+          /* this timeout is hopefully aborted by a SIGCHLD */
           sleep (timeout);
           fprintf (stderr, PROGNAME ": timeout, killing child %s\n", argv[2]);
           kill (pid_child, SIGTERM);
index 66e9d86d755249f3aebac29250239f1c36262968..b14249d49d90da8a89ffeb88a0deaf8c0cad3e95 100644 (file)
@@ -36,3 +36,6 @@ fwk/lib/testfwk$(OBJEXT): fwk/lib/testfwk.c
        $(RRZ80) --maxruntime=3 --mapfile=$(<:.bin=.sym) $< > $@
        -grep -n FAIL $@ /dev/null || true
 
+_clean:
+       rm -f ports/$(PORT)/*.lst ports/$(PORT)/*.o ports/$(PORT)/*.sym
+