Skip to content
Snippets Groups Projects
Commit a2193388 authored by vincem95's avatar vincem95
Browse files

ue3 Abgabe

parent 1fc0208f
Branches
Tags
No related merge requests found
Makefile 0 → 100644
# This makefile compiles all C files in the same directory and produces a single
# executable named solution
CC = gcc
CFLAGS = -std=gnu17 -Wall -Wextra -pedantic -O2 -g -pthread # this uses the C11 standard, if you want to use a different standard, change it to -std=c[NUMBER]
CPPFLAGS = -MMD
LD_FLAGS = -lm
BIN_NAME = solution
SRC_FILES = $(wildcard *.c)
OBJ_FILES = $(SRC_FILES:.c=.o)
DEP_FILES = $(wildcard *.d)
run: $(BIN_NAME)
./$(BIN_NAME)
include $(DEP_FILES)
$(BIN_NAME): $(OBJ_FILES)
$(CC) $(CPPFLAGS) $(LD_FLAGS) $(OBJ_FILES) -o $@
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
clean:
@rm -v *.o *.d
@rm -v ./$(BIN_NAME)
.PHONY: run clean
......@@ -28,7 +28,7 @@ void *crossBridge(void *threadid){
long tid;
int i, _error = 0;
tid = (long) threadid;
for (i=0;i <= 100000; i++) {
for (i=0;i <= 10000; i++) {
_error = pthread_mutex_lock(&lock);
check('s',tid); //check Funktion um zu gucken ob es einen Unfall gab / geben wird.
......
main.d 0 → 100644
main.o: main.c
main.o 0 → 100644
File added
solution 0 → 100755
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment