Skip to content
Snippets Groups Projects
Commit 1815d9f5 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Nachbereitung 12.12.2019

parent f3764bee
No related branches found
No related tags found
No related merge requests found
hello-6: hello-6.o pruzzel.o
gcc hello-6.o pruzzel.o -o hello-6
hello-6.o: hello-6.c
gcc -Wall -O hello-6.c -c
pruzzel.o: pruzzel.c
gcc -Wall -O pruzzel.c -c
hello-6: hello-6.o pruzzel.o
gcc hello-6.o pruzzel.o -o hello-6
hello-6.o: hello-6.c pruzzel.h
gcc -Wall -O hello-6.c -c
pruzzel.o: pruzzel.c pruzzel.h
gcc -Wall -O pruzzel.c -c
TARGET = hello-6
OBJECTS = hello-6.o pruzzel.o
HEADERS = pruzzel.h
CFLAGS = -Wall -O
$(TARGET): $(OBJECTS)
gcc $(OBJECTS) -o $(TARGET)
%.o: %.c $(HEADERS)
gcc $(CFLAGS) $< -c
clean:
rm -f $(OBJECTS) $(TARGET)
#include <avr/io.h>
#define F_CPU 16000000
#include <util/delay.h>
int main (void)
{
DDRD = 0x01;
PORTD = 0x01;
while (1)
{
while ((PIND & 0x02) == 0)
; /* just wait */
PORTD ^= 0x01;
}
return 0;
}
#include "pruzzel.h"
int main (void)
{
pruzzel ("Hello, world!\n");
return 0;
}
No preview for this file type
......@@ -524,6 +524,8 @@
\end{frame}
\iffalse
\subsection{Binärdarstellung negativer Zahlen}
\begin{frame}[fragile]
......@@ -709,4 +711,6 @@
\end{frame}
\fi
\end{document}
cassini/home/peter/bo/2019ws/hp/20191212> cat Makefile
hello-6: hello-6.o pruzzel.o
gcc hello-6.o pruzzel.o -o hello-6
hello-6.o: hello-6.c
gcc -Wall -O hello-6.c -c
pruzzel.o: pruzzel.c
gcc -Wall -O pruzzel.c -c
cassini/home/peter/bo/2019ws/hp/20191212> make
make: „hello-6“ ist bereits aktuell.
cassini/home/peter/bo/2019ws/hp/20191212> rm hello-6
cassini/home/peter/bo/2019ws/hp/20191212> make
gcc hello-6.o pruzzel.o -o hello-6
cassini/home/peter/bo/2019ws/hp/20191212> rm hello-6 *.o
cassini/home/peter/bo/2019ws/hp/20191212> make
gcc -Wall -O hello-6.c -c
gcc -Wall -O pruzzel.c -c
gcc hello-6.o pruzzel.o -o hello-6
cassini/home/peter/bo/2019ws/hp/20191212> ./hello-6
Hello, world!
cassini/home/peter/bo/2019ws/hp/20191212> ls -l pruzzel.c
-rw-r--r-- 1 peter peter 89 Nov 21 17:08 pruzzel.c
cassini/home/peter/bo/2019ws/hp/20191212> touch pruzzel.c
cassini/home/peter/bo/2019ws/hp/20191212> ls -l pruzzel.c
-rw-r--r-- 1 peter peter 89 Dez 12 16:26 pruzzel.c
cassini/home/peter/bo/2019ws/hp/20191212> make
gcc -Wall -O pruzzel.c -c
gcc hello-6.o pruzzel.o -o hello-6
cassini/home/peter/bo/2019ws/hp/20191212> mv -i Makefile Makefile-1
cassini/home/peter/bo/2019ws/hp/20191212> make -f Makefile-1
make: „hello-6“ ist bereits aktuell.
cassini/home/peter/bo/2019ws/hp/20191212>
#include <stdio.h>
int pruzzel (const char *bla)
{
printf ("%s", bla);
return 42;
}
extern int pruzzel (const char *bla);
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment