parent
43914175db
commit
fdcf5f5b9f
@ -0,0 +1,17 @@
|
|||||||
|
#include "Hello.hpp"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
Hello::Hello()
|
||||||
|
:
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
ostream &operator<<(ostream &os, const Hello &H) {
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
|||||||
|
#ifndef HELLO_HPP
|
||||||
|
#define HELLO_HPP
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
class Hello {
|
||||||
|
|
||||||
|
public:
|
||||||
|
Hello();
|
||||||
|
|
||||||
|
friend std::ostream &operator<<(ostream &os, const Hello &H);
|
||||||
|
|
||||||
|
~Hello()=default;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // HELLO_HPP
|
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
#CC : le compilateur à utiliser
|
||||||
|
CC=gcc
|
||||||
|
|
||||||
|
#CFLAGS : les options de compilation
|
||||||
|
CFLAGS= -std=c17 -Wall
|
||||||
|
|
||||||
|
# les fichiers sources : tous les fichiers présents dans src/
|
||||||
|
SRC=$(wildcard src/*.c)
|
||||||
|
|
||||||
|
# les fichiers objets (.o)
|
||||||
|
OBJ=$(patsubst src/%.c,obj/%.o,$(SRC))
|
||||||
|
|
||||||
|
|
||||||
|
#edition des liens : génération de l'exécutable à partir des .o
|
||||||
|
bin/exe: $(OBJ)
|
||||||
|
$(CC) $(OBJ) -o $@
|
||||||
|
|
||||||
|
# génération des .o à partir des .cpp et .hpp crrespondants :
|
||||||
|
obj/%.o: src/%.c
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
#nettoyage : destruction des .o et de l'exécutable
|
||||||
|
clean:
|
||||||
|
rm obj/*.o bin/exe
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 176 KiB |
Loading…
Reference in new issue