asma: some buildenv improvements
authorBernhard Urban <lewurm@gmail.com>
Fri, 26 Feb 2010 21:26:25 +0000 (22:26 +0100)
committerBernhard Urban <lewurm@gmail.com>
Fri, 26 Feb 2010 21:26:25 +0000 (22:26 +0100)
asma/Makefile
asma/main.c

index 0308c8bc284983f94b19ad5677cc86f77f12dc44..0aca7516fd4065a62266c1c7fad1611ef6ba6203 100755 (executable)
@@ -1,15 +1,20 @@
-all: asma.o
+NAME := asma
+all: $(NAME).o
 
-asma.o: asma.s
-       gcc -c -o asma.o asma.s
+$(NAME).o: $(NAME).s
+       @echo "  COMPILE  $<"
+       @gcc -c -o $(NAME).o $(NAME).s
 
 .PHONY: clean
 clean:
-       rm -f asma.o asma
+       rm -f $(NAME).o $(NAME)
 
-test1: all
-       gcc -pedantic -ansi -Wall -g -o asma asma.s main.c -D_GNU_SOURCE
+1test: all
+       @echo "  COMPILE  $<"
+       @gcc -pedantic -ansi -Wall -g -o $(NAME) $(NAME).s main.c -D_GNU_SOURCE
+       @echo "execute ./$(NAME)"
+       @./$(NAME)
 
-test2:
-       /usr/ftp/pub/ublu/test/asma/test
+2test:
+       /usr/ftp/pub/ublu/test/$(NAME)/test
 
index 4c290ab0adfe364b63b70c4848a23efb8aa997e5..a0da9e63c8cacf67d958db1d8ed113a3dced96fb 100644 (file)
@@ -16,14 +16,14 @@ unsigned char *asma_ref(unsigned char *s)
 }
 
 int main(int argc, char **argv) {
-       char *input1[]={"asdfABCDEFGHKL54", "foofuuMUHkk"};
+       char *input1[]={"asdfABCDEFGHKL54", "foofuuMUHkk", "AbC"};
        char *output1;
        char *output2;
        char *input2;
        char *input3;
        int i;
 
-       for(i = 0; i < 2; i++) {
+       for(i = 0; i < 3; i++) {
                input2 = strdup(input1[i]);
                input3 = strdup(input1[i]);
                output1 = (unsigned char*) asma_ref((unsigned char *)(input2));
@@ -37,6 +37,7 @@ int main(int argc, char **argv) {
                } else {
                        printf("Testfall \"%s\" passt.\n", output1);
                }
+               printf("\n");
 
                free(input2);
                free(input3);