Update README, init 04_intro_to_sockets

This commit is contained in:
Daniel Meiburg 2024-05-15 00:43:00 +02:00
parent c452d42213
commit a29cccd3ea
Signed by: dm
GPG Key ID: E5827ECFFE0AA4F2
6 changed files with 59 additions and 5 deletions

View File

@ -0,0 +1,39 @@
CC = gcc
CFLAGS = -Wall -Ilib
#LDFLAGS = -lgpiod
# Directories
SRCDIR = src
LIBDIR = lib
OBJDIR = obj
# Source files
LIB_SOURCES = $(wildcard $(LIBDIR)/*.c)
SRC_SOURCES = $(wildcard $(SRCDIR)/*.c)
# Object files
LIB_OBJECTS = $(LIB_SOURCES:$(LIBDIR)/%.c=$(OBJDIR)/%.o)
SRC_OBJECTS = $(SRC_SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
# Target executable
TARGET = sockets
# Create obj directory if it doesn't exist
$(shell mkdir -p $(OBJDIR))
# Rules
all: $(TARGET)
$(TARGET): $(LIB_OBJECTS) $(SRC_OBJECTS)
$(CC) $(LIB_OBJECTS) $(SRC_OBJECTS) -o $@ $(LDFLAGS)
$(OBJDIR)/%.o: $(LIBDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJDIR)/*.o $(TARGET)
.PHONY: all clean

View File

@ -0,0 +1,11 @@
# IO Access
This program demonstrates how to access the GPIO pins on the Raspberry Pi using
a LED, a button and a temperature sensor.
## Usage
```bash
$ make
$ ./io
```

View File

View File

@ -0,0 +1,5 @@
#ifndef SOCKETS_LIB_H
#define SOCKETS_LIB_H
#endif // SOCKETS_H

View File

@ -0,0 +1,4 @@
int main() {
return 0;
}

View File

@ -1,8 +1,3 @@
# Distributed Embedded Systems # Distributed Embedded Systems
This repo contains my code for the Distributed Embedded Systems course at the University of Rostock. This repo contains my code for the Distributed Embedded Systems course at the University of Rostock.
```bash
make
./io
```