Skip to content
Snippets Groups Projects
Commit 108b33d3 authored by Florian Burgener's avatar Florian Burgener
Browse files

Initial structure + update .gitignore

parent b31c2a3c
Branches
No related tags found
No related merge requests found
*.o
ex1
ex2
ex3
ex4
ex1/ex1
ex2/ex2
ex3/ex3
ex4/ex4
TARGET = ex1
LIBS = -lm
CC = gcc
CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak
.PHONY: default clean
default: $(TARGET)
ex1.o: ex1.c
$(CC) $(CFLAGS) -c $< -o $@
run: $(TARGET)
./$<
$(TARGET): ex1.o
$(CC) ex1.o $(CFLAGS) $(LIBS) -o $@
clean:
rm -f *.o $(TARGET)
/**
* @file ex1.c
* @author Florian Burgener
* @brief Exercice 1
* @version 1.0
* @date 2022-01-25
*
* @copyright Copyright (c) 2021
*
*/
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
// int32_t values_length = 5;
// double values[values_length];
// for (int32_t i = 0; i < values_length; i += 1) {
// double value;
// scanf("%lf", &value);
// values[i] = value;
// }
// int32_t values_length = 5;
// int32_t values[values_length];
// for (int32_t i = 0; i < values_length; i += 1) {
// int32_t value;
// scanf("%d", &value);
// values[i] = value;
// }
// char a[100];
// int32_t b;
// scanf("%s %d", a, &b);
// printf("%s %d\n", a, b);
printf("ex1\n");
return EXIT_SUCCESS;
}
TARGET = ex2
LIBS = -lm
CC = gcc
CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak
.PHONY: default clean
default: $(TARGET)
ex2.o: ex2.c
$(CC) $(CFLAGS) -c $< -o $@
run: $(TARGET)
./$<
$(TARGET): ex2.o
$(CC) ex2.o $(CFLAGS) $(LIBS) -o $@
clean:
rm -f *.o $(TARGET)
/**
* @file ex2.c
* @author Florian Burgener
* @brief Exercice 2
* @version 1.0
* @date 2022-01-25
*
* @copyright Copyright (c) 2021
*
*/
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
// int32_t values_length = 5;
// double values[values_length];
// for (int32_t i = 0; i < values_length; i += 1) {
// double value;
// scanf("%lf", &value);
// values[i] = value;
// }
// int32_t values_length = 5;
// int32_t values[values_length];
// for (int32_t i = 0; i < values_length; i += 1) {
// int32_t value;
// scanf("%d", &value);
// values[i] = value;
// }
// char a[100];
// int32_t b;
// scanf("%s %d", a, &b);
// printf("%s %d\n", a, b);
printf("ex2\n");
return EXIT_SUCCESS;
}
TARGET = ex3
LIBS = -lm
CC = gcc
CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak
.PHONY: default clean
default: $(TARGET)
ex3.o: ex3.c
$(CC) $(CFLAGS) -c $< -o $@
run: $(TARGET)
./$<
$(TARGET): ex3.o
$(CC) ex3.o $(CFLAGS) $(LIBS) -o $@
clean:
rm -f *.o $(TARGET)
/**
* @file ex3.c
* @author Florian Burgener
* @brief Exercice 3
* @version 1.0
* @date 2022-01-25
*
* @copyright Copyright (c) 2021
*
*/
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
// int32_t values_length = 5;
// double values[values_length];
// for (int32_t i = 0; i < values_length; i += 1) {
// double value;
// scanf("%lf", &value);
// values[i] = value;
// }
// int32_t values_length = 5;
// int32_t values[values_length];
// for (int32_t i = 0; i < values_length; i += 1) {
// int32_t value;
// scanf("%d", &value);
// values[i] = value;
// }
// char a[100];
// int32_t b;
// scanf("%s %d", a, &b);
// printf("%s %d\n", a, b);
printf("ex3\n");
return EXIT_SUCCESS;
}
TARGET = ex4
LIBS = -lm
CC = gcc
CFLAGS = -g -Wall -Wextra -pedantic -fsanitize=address -fsanitize=leak
.PHONY: default clean
default: $(TARGET)
ex4.o: ex4.c
$(CC) $(CFLAGS) -c $< -o $@
run: $(TARGET)
./$<
$(TARGET): ex4.o
$(CC) ex4.o $(CFLAGS) $(LIBS) -o $@
clean:
rm -f *.o $(TARGET)
/**
* @file ex4.c
* @author Florian Burgener
* @brief Exercice 4
* @version 1.0
* @date 2022-01-25
*
* @copyright Copyright (c) 2021
*
*/
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
// int32_t values_length = 5;
// double values[values_length];
// for (int32_t i = 0; i < values_length; i += 1) {
// double value;
// scanf("%lf", &value);
// values[i] = value;
// }
// int32_t values_length = 5;
// int32_t values[values_length];
// for (int32_t i = 0; i < values_length; i += 1) {
// int32_t value;
// scanf("%d", &value);
// values[i] = value;
// }
// char a[100];
// int32_t b;
// scanf("%s %d", a, &b);
// printf("%s %d\n", a, b);
printf("ex4\n");
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment