Update README, init 04_intro_to_sockets
This commit is contained in:
parent
c452d42213
commit
a29cccd3ea
|
|
@ -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
|
||||
|
|
@ -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
|
||||
```
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef SOCKETS_LIB_H
|
||||
#define SOCKETS_LIB_H
|
||||
|
||||
|
||||
#endif // SOCKETS_H
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue