Initial C commit

This commit is contained in:
Afonso Franco 2024-02-20 11:48:56 +00:00
parent 80c977769e
commit 00589cf691
Signed by: afonso
SSH key fingerprint: SHA256:JiuxZNdA5bRWXPMUJChI0AQ75yC+cXY4xM0IaVwEVys
4 changed files with 38 additions and 0 deletions

10
TPs/TP02/c/.clang-format Normal file
View file

@ -0,0 +1,10 @@
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
UseTab: Always
BreakBeforeBraces: Attach
ColumnLimit: 100
PenaltyReturnTypeOnItsOwnLine: 1000000
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterDefinitionReturnType: None
SeparateDefinitionBlocks: Always

1
TPs/TP02/c/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
bin/*.out

20
TPs/TP02/c/Makefile Normal file
View file

@ -0,0 +1,20 @@
CC=gcc
CFLAGS=-Wall -Wextra -O2
LDFLAGS=-lssl -lcrypto
ARCH=$(shell uname -m)
ifeq ($(ARCH), arm64)
# Mac ARM installation
CFLAGS+= -I/opt/homebrew/opt/openssl@3.2/include
LDFLAGS+= -L/opt/homebrew/opt/openssl@3.2/lib
endif
all: main
main: main.c
$(info Detected $(ARCH) arquitecture.)
$(CC) $(CFLAGS) $(LDFLAGS) main.c -o bin/main.out
clean:
rm -f main.out

7
TPs/TP02/c/main.c Normal file
View file

@ -0,0 +1,7 @@
#include <openssl/ssl.h>
int main(){
return 0;
}