Initial C commit
This commit is contained in:
parent
80c977769e
commit
00589cf691
4 changed files with 38 additions and 0 deletions
10
TPs/TP02/c/.clang-format
Normal file
10
TPs/TP02/c/.clang-format
Normal 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
1
TPs/TP02/c/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin/*.out
|
20
TPs/TP02/c/Makefile
Normal file
20
TPs/TP02/c/Makefile
Normal 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
7
TPs/TP02/c/main.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <openssl/ssl.h>
|
||||
|
||||
int main(){
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in a new issue