Skip to content

Commit

Permalink
lab-1: Automate the generation of Fibonacci series
Browse files Browse the repository at this point in the history
  • Loading branch information
jserv committed Aug 1, 2014
1 parent 8f78c22 commit aa1c5db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 9 additions & 2 deletions lab-1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ objects = fibseq.o fib.o

default: fibseq

.PHONY: default clean
.PHONY: default clean qemu

fibseq: $(objects)
$(CC) $(LDFLAGS) -o $@ $^
Expand All @@ -23,5 +23,12 @@ fibseq.o: fibseq.c
clean:
rm -f $(objects) fibseq

QEMU_CMD = qemu-arm -L /usr/arm-linux-gnueabihf ./fibseq &
CMD = yes 9 | $(call QEMU_CMD) && sleep 1
qemu: fibseq
qemu-arm -L /usr/arm-linux-gnueabihf ./fibseq
@yes 5 | $(call QEMU_CMD)
@sleep 1
@yes 6 | $(call QEMU_CMD)
@sleep 1
@yes 7 | $(call QEMU_CMD)
@sleep 1
1 change: 0 additions & 1 deletion lab-1/fibseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ int main(int argc, char **argv)
int number=0;
int result=0;

printf("Please input a number:");
scanf("%d",&number);
result = fibonacci(number);
printf("The fibonacci sequence at %d is: %d\n", number, result);
Expand Down

0 comments on commit aa1c5db

Please sign in to comment.