From 3d8dde51f43b8e0ff0c0dc171b74849ef0c62ccb Mon Sep 17 00:00:00 2001 From: hugo Date: Tue, 12 Nov 2019 19:21:17 +0100 Subject: [PATCH 1/4] explication header --- Makefile | 100 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 43 deletions(-) diff --git a/Makefile b/Makefile index 7a7f077..0b0b671 100644 --- a/Makefile +++ b/Makefile @@ -149,7 +149,8 @@ re: fclean all # ranlib [322 G] ## 3 - fichiers .h [335 G] -# ecrir un header [] +# a quoi sert un header [] +# ecrire un header [] # comment ca se compile [] ## 4 - ecrire un make file... [] @@ -334,7 +335,7 @@ re: fclean all ## ---------------- # - - - - - - - - - - - - -# ecrire un header +# a quoi sert un header # - - - - - - - - - - - - # si on utilise une librairie c'est parce qu'on peut avoir @@ -360,69 +361,82 @@ re: fclean all # fonctions de la librairie, gcc s'occupera de l'expandre # a la precompilation # -# # -# # -# # -# # -# # -# # -# # + +# - - - - - - - - - +# ecrire un header +# - - - - - - - - - + +# [ft_putchar.c] +# # #include "libtest.h" +# # +# # void ft_putchar(char c) +# # { +# # write(1, &c, 1); +# # } # -# # -# # -# # -# # -# # -# # -# # +# [main.c] +# # #include "libtest.h" +# # +# # int main() +# # { +# # ft_putchar('0'); +# # return (0); +# # } # +# [libetest.h] +# # # ifndef LIBTEST_H +# # # define LIBTEST_H # # +# # #include # # +# # void ft_putchar(char c); # # -# # -# # -# # +# # # endif # -# # -# # -# # -# # -# # -# # -# # -# # +# en tete de chaque fichier de fonctions on ecrit +# l'include de la librairie, comme un include classique, +# precede d'un #, mais avec le nom de la librairie entre +# guillemets et non pas entre signes comparateurs # -# # -# # -# # -# # -# # -# # -# # -# # -# # +# dans le fichier de la librairie on ajoute les includes +# dont on peut avoir besoin pour que la librairie ou des +# fonctions auont besoin, et les prototypes des fonctions # +# on entoure toutes ces infos par une definition, afin +# de proteger le .h d'etre expand plusieurs fois dans +# un fichier # - - - - - - - - - - - - # comment ca se compile # - - - - - - - - - - - - +# au moment de la compilation il faut indiquer a gcc ou +# se trouve le fichier .h avec le flag -I # +# par exemple pour l'architecture de dossier suivante : # +# # file +# # -> main.c +# # -> ft_putchar.c +# # -> libtest.h # +# il faut ecrire : # +# # gcc main.c ft_putchar.c -I. # +# et si la compilation utilise une librairie, par exemple +# si on met la fonction ft_putchar.c dans une librairie : # +# # gcc -c ft_putchar.c +# # (donne ft_putchar.o) +# # ar rc libtest.a ft_putchar.o # +# on peut alors compiler avec la librairie .a et le +# fichier .h : # +# # gcc main.c -I. -L. -ltest -o test # -# -# -# -# -# -# -# +# qui sort l'executable "test" ## ---------------------------------------------------- ## 4 - ecrire un make file pour aider a la compilation From ac4a5e088cfb8c6d138fc228838c66ac515d33ae Mon Sep 17 00:00:00 2001 From: Hugo LAMY Date: Wed, 13 Nov 2019 12:48:59 +0100 Subject: [PATCH 2/4] ajout explications --- .OLDMakefile.swp | Bin 0 -> 16384 bytes Makefile | 119 +++++++++++++++++++------------- main.c | 24 ------- main.o | Bin 676 -> 0 bytes astuce => test/.Makefile.swp | Bin 8520 -> 12288 bytes test/Makefile | 9 +++ libtest.a => test/libtest.a | Bin test/main.c | 9 +++ test/main.o | Bin 0 -> 728 bytes putchar.c => test/putchar.c | 2 +- putchar.o => test/putchar.o | Bin a.out => test/test | Bin 8520 -> 8520 bytes test/test.h | 9 +++ transform.c => test/transform.c | 2 + transform.o => test/transform.o | Bin truc | Bin 8520 -> 0 bytes 16 files changed, 102 insertions(+), 72 deletions(-) create mode 100644 .OLDMakefile.swp delete mode 100644 main.c delete mode 100644 main.o rename astuce => test/.Makefile.swp (53%) mode change 100755 => 100644 create mode 100644 test/Makefile rename libtest.a => test/libtest.a (100%) create mode 100644 test/main.c create mode 100644 test/main.o rename putchar.c => test/putchar.c (71%) rename putchar.o => test/putchar.o (100%) rename a.out => test/test (88%) create mode 100644 test/test.h rename transform.c => test/transform.c (67%) rename transform.o => test/transform.o (100%) delete mode 100755 truc diff --git a/.OLDMakefile.swp b/.OLDMak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b(Cysk1Tl1iCf+ZT7wI@-iM^|z7RVWlD)=!_=@Z*dMw z2vT%3XuA4|ga9Nt?!l%OEwt%yCd&upq=yHlEA8+D| zR+2Bv*I%($E6qCPU4~U=7qt*&G|T8XRo3t*jqP42(}}YVc|pxFW~-!0X-KN2ESYU8 ztFFr;tQXv04N2!nPS!8djGPsDr@Ttq=#DFl3pvkLz3RrawxigigLs&A&Wv4b8Nb-d z&e$)v^R*7iMS1m+#vZzLqa@?c?CD&yjTu`*wn@jB@*FR2*zJ~?;X%1|^2DoY zIChje&^K-L?dX48pkw@w{Ja{dQ{Oi-l}!7_@BscOf73K!N-j>%EXqu97OH%>BiFdP z+bNI5nIi_)JKZAc2adReUS_2Iob5ZVmDD<+qbHejXOv6l+Iu(HaLr32IgeF|3;X>| z&8G$44K}Q^qtmw-G(D;58=G8RBQ3=IB^wl^B#<=&H9sj)V)|k&+aG)XVhbOs?6#_G zU1Y^8Bs>rRY;)(Ljk0TLUV0FP>MNbh;5?kkN?)^y$5Cod%9iVe=J+%tg(KzdNK&%a zHpDP8fcD^Bwr^AXbpdZU)GRj=*%wK6k?3faB+*wAwuXHwxvH{?MADRy&#JLJYlcOX z=@CqXn3{Nl#Z2--W2i(PRa~g(PgKwTB*WZBk9B`r$B)N$Kb-2$DT(^3tcw z^oVDbP3kL)GV{a0`IR?Vx#{v+M_!_YylGkqV{)iS#Cs^~gX#_9QChYt~`_>?3A~sOlO96 MxY|rAB~kl-0i4)QBme*a literal 0 HcmV?d00001 diff --git a/Makefile b/Makefile index 0b0b671..55736c4 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,11 @@ +# - - - - - - - - - # +# variables names # +# - - - - - - - - - # -# - - - - - - - - - -# variables names -# - - - - - - - - - +# each variable will expand in its value when used NAME = libft.a +DEP = libft.h CC = gcc CFLAGS = -Wall -Wextra -Werror -I. -c SRCS = ft_atoi.c \ @@ -75,59 +77,67 @@ SRCS = ft_atoi.c \ ft_arraymap.c \ ft_putnbrbase.c \ ft_strmultisplit.c + +ODIR = ./builds + +# - "addprefix" is a built-in expansion function used by +# makefile to perform a transformation on file names, in +# this case we want to put all the .o files in a +# subdirectory named "build" +# - $(SRCS:.c=.o) is a "substitute reference", an +# abbreviation for the expansion function "patsubst" : +# $(patsubst %.c,%.o,$(SRCS)) OBJ = $(addprefix $(ODIR)/, $(SRCS:.c=.o)) -# - - - - - - - - - - -# rules to execute -# - - - - - - - - - - -# when you write "make" in command line it will execute the -# first rule wrote in the Makefile, wich is ALL by convention -# because usually when you type "make" you expect it to build all -# it first verify if ODIR is created and if not create it -# then it calls NAME to create the library +# - - - - - - - - - - - # +# rules to execute # +# - - - - - - - - - - - # + +# - when you write "make" in command line it will execute +# the first rule wrote in the Makefile, wich is "all" by +# convention because usually when you type "make" you +# expect it to build all +# - it first verify if ODIR is created and if not create +# it, then it calls NAME to create the library all: $(ODIR) $(NAME) -# ODIR create the folder where all the .o files will be stored +# create the folder where all the .o files will be stored $(ODIR): mkdir -p $(ODIR) -# NAME will create the library libft.a -# first it checks if any OBJ (files.o) have more recent +# - NAME will create the library libft.a +# - first it checks if any OBJ (files.o) have more recent # date of modification than NAME (libft.a), and for each # it will execute - -# first it checks if the date of modification of any .o (OBJ) -# is more recent thant the one of libft.a (NAME) -# and for each of them it will execute -# if only one .c has been modified then only one .o will have been too -# so NAME will execute only for this one -# ranlib doesn't need to be seen so it's precedeed by a "@" -$(NAME): $(OBJ) +# - $(OBJ) will expand in the list of files.o and each of +# them will call the rule "$(ODIR)/%.o:" below because it +# has its exact pattern +# - NAME will execute only for the .c that has been +# modified since last creation of NAME +# - ranlib is precedeed by a "@" to avoid being print +$(NAME): $(OBJ) $(DEP) ar -rc $@ $< @ranlib $@ + +# - this rule depend of the list of files.c and file.h +# - if any of these files are more recent than the file +# builds/file.o equivalent then the rule will rebuild +# this .o file $(ODIR)/%.o: %.c - $(COMPILE.c) -o $@ $< + $(CC) $(CFLAGS) -c $< + clean: /bin/rm -rf $(ODIR) + fclean: clean /bin/rm -f $(NAME) + re: fclean all + .PHONY: clean -all: $(NAME) -$(NAME): $(OBJ) - ar rc $(NAME) $(OBJ) - @ranlib $(NAME) -clean: - /bin/rm -f $(OBJ) -fclean: clean - /bin/rm -f $(NAME) -re: fclean all -.PHONY: clean fclean all re - - @@ -446,20 +456,9 @@ re: fclean all # makefile basique # - - - - - - - - - -# - - - - - - - - - - - - - - - - - - - - - - - - - -# ne pas tout recompiler a la moindre modification -# - - - - - - - - - - - - - - - - - - - - - - - - - - -# - - - - - - - - - - - - - - - - - - - - -# mettre les fichiers .o dans un dossier -# - - - - - - - - - - - - - - - - - - - - - -# - - - - - - - - - - - - -# make un autre makefile -# - - - - - - - - - - - - - # exemple d'un makefilede basic # +# # |DECLARATION VARIABLES # # NAME = libtest.h # # CC = gcc # # CFLAGS = -I. -c @@ -476,6 +475,19 @@ re: fclean all # par exemple pour construire des .o a partir de .c # qui sont utilisees par défaut si les variables # sont bien nomee (genre CC ou CFLAGS) + +# - - - - - - - - - - - - - - - - - - - - - - - - - +# ne pas tout recompiler a la moindre modification +# - - - - - - - - - - - - - - - - - - - - - - - - - + +# - - - - - - - - - - - - - - - - - - - - +# mettre les fichiers .o dans un dossier +# - - - - - - - - - - - - - - - - - - - - + +# - - - - - - - - - - - - +# make un autre makefile +# - - - - - - - - - - - - + # # cependant si on veut mettre les fichiers .o dans un # sous-fichier BUILDS il n'y a pas de built-in pattern @@ -507,3 +519,16 @@ re: fclean all # $< = "la premiere valeur a droite de :" # $^ = "toutes les valeurs a droite de :" # + + + +# shape of a rule : +# +# target: prerequisites +# recipe +# +# before executing its recipes, makefile verify if any of +# the prerequisites has been more recently modify than +# the target, and if so execute the recipes + + diff --git a/main.c b/main.c deleted file mode 100644 index f282343..0000000 --- a/main.c +++ /dev/null @@ -1,24 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* main.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: hulamy +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/11/08 13:33:32 by hulamy #+# #+# */ -/* Updated: 2019/11/08 13:33:45 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - - -/*void ft_putchar(char c); - -int transform(int a); -*/ -int main() -{ - int a = 't'; - a = transform(a); - ft_putchar(a); - return (0); -} diff --git a/main.o b/main.o deleted file mode 100644 index 7160f6f25d3c6a0013abc94f16c945abc8bee520..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 676 zcma)3F-yZ>5WQ4sMQzQXpx}^#gNvX}j*1pCIEYkmku$`UbVv*(#o{Csif$eKDQ*f1 zj;{Uz!9o9ki25$y_tDQm@WH!#?{arJlBbXNuL_YfMhM_Icq76Cfdz0w{2#c~^=I8< zJa&>$_6nHusFy3Pe6w-b9C@SaTF5@R<+!Bog1Im~l9|KPBn!fvyXjdwJz?J6v7aw% z@%wM?W8+iWZ&wjsMXlZW{Rj8xUbKa}(#5$}xwuWd zbG}bb&vo4C%ES;|OQZ)7R7prIoEC;2n`X5LITzm7mR-)Xc&MHYz13eo4++gbCK=x~v!7YC|; zYd5A3w-l9!g}mG;N-vtydN;n%3H+{S9OI6R(^8kN=LhbTQ`mw41ZEb9jhCw|QK?wS z+q*V5*2UWD>CD&S0ti3=0uX=z1Rwwb2tZ(d1k5l+_x!pG$t$OmIrV2wN=y)d00bZa z0SG_<0uX=z1Rwwb2+W~?IwvYG6J2xc@BfqU{~uhxb6z;loF~pB=Yey>vHe#Z&FOI3 z91I9R00Izz00bZa0SG_<0uX?}zY$1ZXf5dHGpEJYE@gff3BY(gKCr!i z(9R}D>~<*ZALV)dsNT$yeXdRl;w4ez>g0H@Ds@eUS>n^YWZPtqc%6&B@&|nLFgCiU PB7QQF8jQR!>Pt=EndneJ literal 8520 zcmeHN&ubGw7@gQwi||FZ0RiWO_E~DE`{{KGS?BH32bouh_2q^4Ymmc2cIYQ#0sPpWnLX<1?ZW z*YK6Yl`Ega7F^1~=ytn2K_=hKj%<9(xE z>V7&PWjekeUl`-rzghPu4)SrG1aWoU4iDYDVGj=ZYtE{hConChlOazquTK0fdfCA$ z-@6&*abj(jrKA(RC`S;Z_G~WzbB-mHj30rs3>w!ZeZS|mW!0@;P0)%GO`-+flg~Ll z=~SX;av?nlOgjZ<9?|UA=S`FSj|<0M_uYH3`SKEC7CZzOt%sGfuC!}-7rKCYm~Gn5 zVg72qSXV*geFxxdWB#G-O-v@Kzgki7%Hci=}nJt+y!Jr84LPxabw_ zU&T^v`9t`@`!!`8UtHW-S=?FP@K7n1{FZ7v`6GqW8}74<+XdTGwb*Lj+v00MtZ4t# zlwQ{(1cq17WKcxMysif**QRk1-@bUBSKhauCWZw|^$vkOdOzZHzNgYy=ia^rd-HI4 z*Uzxp{i9F)Qpo6(J5EX=G}?uxFfFd`$U6S>cHhKFP}OT8zK>lHMX~f$|sNf{%}-bAs*`Q z5uF@u!F%yU-$j{p{7-NK3W?m5Un%2LfoR_CK-*rk&q F{R05D^`rm* diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..6596621 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,9 @@ +SRC = main.c putchar.c transform.c +DEP = test.h +OBJ = $(SRC:.c=.o) + +test: $(OBJ) + gcc -I. -o test $(OBJ) +%.o: %.c $(DEP) + gcc -I. -c $< + diff --git a/libtest.a b/test/libtest.a similarity index 100% rename from libtest.a rename to test/libtest.a diff --git a/test/main.c b/test/main.c new file mode 100644 index 0000000..45b5479 --- /dev/null +++ b/test/main.c @@ -0,0 +1,9 @@ +#include "test.h" + +int main() +{ + int a = 't'; + a = transform(a); + ft_putchar(a); + return (0); +} diff --git a/test/main.o b/test/main.o new file mode 100644 index 0000000000000000000000000000000000000000..8a91bcf5ec6123301d0efa883e5a7535f2188f79 GIT binary patch literal 728 zcmb7BF-yZ>5WQ4sMQt01feF2M3V~UF0LwmUc*5Vv0o&3I%ED;^
e?H6mE&G$vm+%LsZi->jt<0hIgf= ziI@Oi%K4u351|=&^wSnjl(fZbH6;Ps;` +#include "test.h" void ft_putchar(char c) { diff --git a/putchar.o b/test/putchar.o similarity index 100% rename from putchar.o rename to test/putchar.o diff --git a/a.out b/test/test similarity index 88% rename from a.out rename to test/test index ca2a6d453345a84aa7ba9f965e656d76186ea2df..b5322265e5aec77c5ce693c8bc9901bdb395f7b1 100755 GIT binary patch delta 360 zcmX@%bi!%E1wjFR1_nk328I?O1_6PI5A7!xFmiCRLHG<)CL1!^3(kQmlY)xQncN5z z-2oN#fQs(ee36l#Nnp!q^KSPSw#7@&o$VBR74UHK2WAUKfz6sM*SRJyU=f(aFDd&X z2&kpg^+&hskB)=<`+mL<0`d(Hcr+goh&?G}aGWXmru@?W(KY>`i| zY$}l982n!~bn*gz9bS+pOn@RFJazI-etpI@n*{|N1nSdD;tNVkk~0#E7#vHA67!1F z@{4jA+?assm>DL>0f`GBqCp-g00a}{91K7-NS>cj0K^0bju@EFzz_iSuM(6G3p@=d QzX2+54AI9p`GP_P01-t@$p8QV delta 368 zcmX@%bi!%E1wjUW1_nk328LcB27`$Y?FIXwf^1N+zR8A+_LCJDIXI=DB2y+eGTIAn zfU5I=if-6^k&&NCz%lRnEY=j0#t!kd#*y=$%%A*$*@BT_vnI=RuE_%Yk}4Y*UMK){ zbh`fNuKfYz7y~(m|2tj3bpG&YJ|Yl%c*2AUlWY0KnShiVzosHLP~M}{^#fG$ziJIo zz^7L>7f3k<|5uHjyn + +void ft_putchar(char c); +int transform(int a); + +# endif diff --git a/transform.c b/test/transform.c similarity index 67% rename from transform.c rename to test/transform.c index 4fa854c..36b8f0d 100644 --- a/transform.c +++ b/test/transform.c @@ -1,3 +1,5 @@ +#include "test.h" + int transform(int a) { return(--a); diff --git a/transform.o b/test/transform.o similarity index 100% rename from transform.o rename to test/transform.o diff --git a/truc b/truc deleted file mode 100755 index 704aeb393fda8aaa24f743376925b3ee50e8be39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8520 zcmeHNOKVd>6rR|sMN6By@NK;m6m`+o$D&9ViS*hOi?3D?p^QnJkU)}_n;Y7K#bOl_ zN~H_;y6^}13w%_exN<4Da-kBzg3DNn@%tuo)0~gy(U}o%V(!k*$J7-CMFTonBOyv$2FqR zuEVRkYbDpA1eJ0iJQ}XK1^KR92X8%m>wrB{!h%R~LR4y$rCb z&u&4zpSBjuQq+lF)K}pn_v|mg<{ZnY>E8`y?HBG#>fhF@WHszx4bX-fU7{7*lg~Ll z=~S#|Vm3Vin{o)sJnp{lOYZyBzxFtvjD8q=d+!W<7Bm1AZM&4Rt+;Di37kSZ$UZG6 zFn{7$*jIkxbNis|WB!5lPnb$zGZ*ADGMjVbneGeS$SV~?5ac+N`14kk&y(6FUq%cA zh5^HXVZbn87%&VN1`GrLnt>aU;^*Sr#^T(@!fFMLVtMR!qPzX*ef8kPGW#P7--4_5 z20g2GnJ=G9FW1ByA1ahz@SI&-FW42; ziY(GHFkl!k3>XFs1BL;^fMLKeU>GnA z7zX|e20FTe*O+KWh?j@zGF--R-;B%aYmQhJPOu{+r=64=hd~KQ+{ZV|Oj5>Y;^TQY zj=SzC!~0w(n$0C9os8(uL{nK2PPlR^?~W& Date: Thu, 14 Nov 2019 17:05:54 +0100 Subject: [PATCH 3/4] explication makefil en cours --- .Makefile.swo | Bin 0 -> 45056 bytes .Makefile.swp | Bin 0 -> 40960 bytes .OLDMakefile.swp | Bin 16384 -> 0 bytes Makefile | 249 +++++++++++++++++++++++++++++++++--- test/.Makefile.swp | Bin 12288 -> 0 bytes test/Makefile | 38 +++++- test/{ => builds}/main.o | Bin test/{ => includes}/test.h | 0 test/libtest.a | Bin 1616 -> 1616 bytes test/putchar.o | Bin 684 -> 0 bytes test/{ => srcs}/main.c | 0 test/{ => temp}/putchar.c | 0 test/{ => temp}/transform.c | 2 +- test/test | Bin 8520 -> 8520 bytes test/transform.o | Bin 628 -> 0 bytes 15 files changed, 261 insertions(+), 28 deletions(-) create mode 100644 .Makefile.swo create mode 100644 .Makefile.swp delete mode 100644 .OLDMakefile.swp delete mode 100644 test/.Makefile.swp rename test/{ => builds}/main.o (100%) rename test/{ => includes}/test.h (100%) delete mode 100644 test/putchar.o rename test/{ => srcs}/main.c (100%) rename test/{ => temp}/putchar.c (100%) rename test/{ => temp}/transform.c (75%) delete mode 100644 test/transform.o diff --git a/.Makefile.swo b/.Makefile.swo new file mode 100644 index 0000000000000000000000000000000000000000..d86cddc3918210b992dd10a54df44b4239c02405 GIT binary patch literal 45056 zcmeI53z#HTmFH6t$5IhRbVpb;s4A!`ryl*_Wn(klUEM%QH;vs5s65K3%*d+j&PNfE z+1=I12u8!-D4{$|4b#!sp$Ec|ISRbPZxXZ4y&ZztQpBoVw znH5#lUG{v=d}hMGGb`@<+;eZ-bI!fz&aAm?YKM2u_}T)WCl?A|z3Q`99sfX~@JFvN z6y{o0zqX)&nBO8!v~;MEyON;Y77EQ*KV|@b?AfN;Oy}K`*FBfgS~p z4h34x^4K}YUAlhV+BM2>p#N0wsV7`|bn@=y(xX6+0zC@!DA1!oj{-dk^eE7yK#v0d zCMeLH?<>5Nnm#(N?aSluM|FMo#ed%vf4`zD{PFSMH^kp3#2F;{{8s$@>iGMOUEz<5 zpAW|0Kkf=YCVsv*{yr(LaFYLHJb%h@rKlkGA2fD)J$Gxu} z1$q?dQJ_bG9tC<7=ux0YfgS~V6zEZ)M}Zy%{!LQAFBJ+;qUL8w-o^f($p1e)zEJoA z_z3tgcr~~Y90FBP1RKE!I1&7uOuh&11s?!!1+NB8a5cCPtOX~7W5Gkm6$)Pg9|L!Q zTfp_80(OCO!5}ye{Pc;1!Z*REz+K>7;EmuqPzKwhr#XO_261i z0^7lv;91~t;3p_9?gJkKcYs^KYruYR6}SMb1t)>WfS;iV`98Q8ybt_2cqM3nOTh;4 z954cg!9yrE-Vc5s%z?AOFHwek3%nov4R{~;6L38!g8=*v_+KbBJ_Ozd_JVW4>EJZ* zBNP_j2A>1>g4;k9tOp+W9tw|lgPXyN!E?Yd;4>&v{sO!d%z+nyi@^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RB`Bo4t=csLX&? zH!h*%^+s;Szib|-P8G3=vgO`IRMU3j+dP|h^|DhbP2U7Zdx4P;X=r3yjm@-FVUB}8 z66VR)3Mo#LiA`}CZb?|A{Y|z@$bEz?F{-^W%d(p27ESN3{lvrCZA&xhK2K|_-*+HUVZTl(#d!{Q3YC^8Qzwxg@H70pT~J76r@ zZxpk$1N$|4#=J14a)}P&1w}@BQ8O>VG)Q=w%+x93b@q>A6k_$~TAs|p9ZLw72RfQS z^{7s~yBwO?<)bV?OlHz;gR$x}ec88_6^---*0J{DDq*X!aUs9R-g0YCbF^oPk6tKJ z`R9y{ymw8KiwaB!wAHlEA%e7~l3bhdNaX!4mUDIj*)(*YqC5WJbmkf5hmCUeQI=O5 z8Qotz7dxwvb%!e|ogorc86#RcQ1y-`F`FU8EiSq`F&fHT)tXs|kEWN326fJiG}Wc< z%2v}WB#ax$?7&+Q!(Kh&g56ro9w`k1J3A3Kgu^;++@TH`R z%wsnSm?3z<%id-SvBWfEaz&;sHbAV&YH>1ymV&)jZw!)6@vWqQu`&SENbl6b{|8XBYI6Vp literal 0 HcmV?d00001 diff --git a/.Makefile.swp b/.Makefile.swp new file mode 100644 index 0000000000000000000000000000000000000000..e5330346de97491dbefd5ff044fe25adae866cf6 GIT binary patch literal 40960 zcmeI54VWZFdB+El$Vn6*Abvj4zTJb}jk~k=fq4Q7E;)X7&Fbp0YpavVGEvWW8ICvNiOKf(w(#s|GHyi6B(3e180(}YeCD50^PlN>8 zvxinLprlXmrOnL!gZ$_0_mlkRfhFP{;=_;gzpwDWv-D5&pSStnpIdPKr~K!)`rk+T zgjxE7efUZK_tguoAL_%8^1rhRW$9P=@a+B<`U+>)vt<3>eF^j>(3e180(}YeCD4~Z zUjlsz^d-=jKwkoV3H*PQKv=I-F2D%BKn6DJ|C#;&jl(OIJK&RWGh6}}!@1Ca8k`6t za1=cJ)Jo+(xE=lw-V2vN8(t5ufHm+OI0U})luG6A;a2!CybIn0G3~z$I`ooD1`CHtdENreO*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Rk+qwoOS1$ROW zpM&dQ8J6He_yo+rnXmy)fa5{z@RHb~`DrxJXrR%+JD~yh+N*b6bJM)>`=J+;uMFo+ zPrtKC?~^C(bfdVF4otgOW#b(Cysk1Tl1iCf+ZT7wI@-iM^|z7RVWlD)=!_=@Z*dMw z2vT%3XuA4|ga9Nt?!l%OEwt%yCd&upq=yHlEA8+D| zR+2Bv*I%($E6qCPU4~U=7qt*&G|T8XRo3t*jqP42(}}YVc|pxFW~-!0X-KN2ESYU8 ztFFr;tQXv04N2!nPS!8djGPsDr@Ttq=#DFl3pvkLz3RrawxigigLs&A&Wv4b8Nb-d z&e$)v^R*7iMS1m+#vZzLqa@?c?CD&yjTu`*wn@jB@*FR2*zJ~?;X%1|^2DoY zIChje&^K-L?dX48pkw@w{Ja{dQ{Oi-l}!7_@BscOf73K!N-j>%EXqu97OH%>BiFdP z+bNI5nIi_)JKZAc2adReUS_2Iob5ZVmDD<+qbHejXOv6l+Iu(HaLr32IgeF|3;X>| z&8G$44K}Q^qtmw-G(D;58=G8RBQ3=IB^wl^B#<=&H9sj)V)|k&+aG)XVhbOs?6#_G zU1Y^8Bs>rRY;)(Ljk0TLUV0FP>MNbh;5?kkN?)^y$5Cod%9iVe=J+%tg(KzdNK&%a zHpDP8fcD^Bwr^AXbpdZU)GRj=*%wK6k?3faB+*wAwuXHwxvH{?MADRy&#JLJYlcOX z=@CqXn3{Nl#Z2--W2i(PRa~g(PgKwTB*WZBk9B`r$B)N$Kb-2$DT(^3tcw z^oVDbP3kL)GV{a0`IR?Vx#{v+M_!_YylGkqV{)iS#Cs^~gX#_9QChYt~`_>?3A~sOlO96 MxY|rAB~kl-0i4)QBme*a diff --git a/Makefile b/Makefile index 55736c4..f5dc3cc 100644 --- a/Makefile +++ b/Makefile @@ -116,26 +116,36 @@ $(ODIR): # - NAME will execute only for the .c that has been # modified since last creation of NAME # - ranlib is precedeed by a "@" to avoid being print +# - if DEP (libft.h) is modified the library is remade +# - $@ means everything left to ":" +# - $< means first argument right to ":" $(NAME): $(OBJ) $(DEP) ar -rc $@ $< @ranlib $@ -# - this rule depend of the list of files.c and file.h +# - this rule depend of the list of files.c # - if any of these files are more recent than the file # builds/file.o equivalent then the rule will rebuild # this .o file +# - the flag -o is there to put explicit name of the .o +# files since they must be written within a directory +# path (builds/) $(ODIR)/%.o: %.c - $(CC) $(CFLAGS) -c $< + $(CC) $(CFLAGS) -c -o $@ $< +# clean the objects file +# rm is use with it's native path to avoid using an alias clean: /bin/rm -rf $(ODIR) +# clean the objects and executable files fclean: clean /bin/rm -f $(NAME) +# remake the compilation re: fclean all -.PHONY: clean +.PHONY: clean fclean @@ -246,10 +256,9 @@ re: fclean all # si on compile les deux ca marche : # gcc main.c ft_putchar.c -# - - - - - - - - - - - - - - - - - - - - - - - -# les .o : pre-compiler certains fichiers pour -# ne pas les recompiler a chaque fois -# - - - - - - - - - - - - - - - - - - - - - - - +# - - - - - - - - - - - - - - - +# les .o : compiler et linker +# - - - - - - - - - - - - - - - # ca fonctionne mais gcc doit a chaque fois recompiler # ft_putchar.c alors qu'il n'est pas modifie, donc on peut @@ -268,11 +277,14 @@ re: fclean all # objet .o qui est deja traduit en langue d'ordinateur # et pret a etre rajoute a la compilation : # -# # gcc -c ft_putchar.c --> donne ft_putchar.o +# # gcc -c ft_putchar.c --> donne ft_putchar.o +# # gcc -c main.c --> donne main.o # -# qu'on peut compiler avec le fichier contenant le main : +# cette etape qui consiste a transformer les fichiers en +# objets .o s'appelle la compilation, il faut ensuite +# linker les objets, ce qui avec gcc se fait simplement : # -# # gcc file.c ft_putchar.o +# # gcc main.o ft_putchar.o # # on va maintenant voir comment faire une libraire qui # contient tous nos fichiers objets @@ -456,20 +468,136 @@ re: fclean all # makefile basique # - - - - - - - - - -# exemple d'un makefilede basic +# exemple d'un makefilede basic qui sert a creer un +# executable pour un programme : # -# # |DECLARATION VARIABLES -# # NAME = libtest.h -# # CC = gcc +# [archtecture] +# # main.c +# # function01.c +# # function02.c +# # header.h +# # Makefile +# +# [Makefile] +# # # DECLARATION VARIABLES +# # +# # NAME = bin_output +# # CC = gcc # # CFLAGS = -I. -c -# # SRCS = example01.c \ -# # example02.c -# # OBJ = $(SRCS:.c=.o) |ecrit les fichiers .c en .o +# # DEPS = header.h +# # SRCS = main.c \ +# # function01.c \ +# # function02.c +# # ODIR = ./builds +# # OBJS = $(addprefix $(ODIR)/, $(SRCS:.c=.o)) # # -# # all: $(NAME) |make execute sa premiere regle NAME -# # $(NAME): $(OBJ) |NAME execute d'abord OBJ -# # ar -rc $@ $< | +# # +# # # RULES TO EXECUTE +# # +# # all: $(ODIR) $(NAME) +# # $(NAME): $(OBJ) +# # ar -rc $@ $< +# # #clean: +# # /bin/rm -rf $(ODIR) +# # fclean: clean +# # /bin/rm -f $(NAME) +# # re: fclean all +# # .PHONY: all clean fclean re # +# apres avoir ecrit "make" dans le terminal le Makefile +# va s'executer et l'architecture du fichier racine sera +# un peu changee : +# +# [archtecture] +# # main.c +# # main.o +# # function01.c +# # function01.o +# # function02.c +# # function02.o +# # header.h +# # Makefile +# # bin_output +# +# +# +# # - "addprefix" is a built-in expansion function used by +# # makefile to perform a transformation on file names, in +# # this case we want to put all the .o files in a +# # subdirectory named "build" +# # - $(SRCS:.c=.o) is a "substitute reference", an +# # abbreviation for the expansion function "patsubst" : +# # $(patsubst %.c,%.o,$(SRCS)) +# OBJ = $(addprefix $(ODIR)/, $(SRCS:.c=.o)) +# +# # - when you write "make" in command line it will execute +# # the first rule wrote in the Makefile, wich is "all" by +# # convention because usually when you type "make" you +# # expect it to build all +# # - it first verify if ODIR is created and if not create +# # it, then it calls NAME to create the library +# all: $(ODIR) $(NAME) +# +# # create the folder where all the .o files will be stored +# $(ODIR): +# mkdir -p $(ODIR) +# +# # - NAME will create the library libft.a +# # - first it checks if any OBJ (files.o) have more recent +# # date of modification than NAME (libft.a), and for each +# # it will execute +# # - $(OBJ) will expand in the list of files.o and each of +# # them will call the rule "$(ODIR)/%.o:" below because it +# # has its exact pattern +# # - NAME will execute only for the .c that has been +# # modified since last creation of NAME +# # - ranlib is precedeed by a "@" to avoid being print +# # - if DEP (libft.h) is modified the library is remade +# # - $@ means everything left to ":" +# # - $< means first argument right to ":" +# $(NAME): $(OBJ) $(DEP) +# ar -rc $@ $< +# @ranlib $@ +# +# # - this rule depend of the list of files.c +# # - if any of these files are more recent than the file +# # builds/file.o equivalent then the rule will rebuild +# # this .o file +# # - the flag -o is there to put explicit name of the .o +# # files since they must be written within a directory +# # path (builds/) +# $(ODIR)/%.o: %.c +# $(CC) $(CFLAGS) -c -o $@ $< +# +# # clean the objects file +# # rm is use with it's native path to avoid using an alias +# clean: +# /bin/rm -rf $(ODIR) +# +# # clean the objects and executable files +# fclean: clean +# /bin/rm -f $(NAME) +# +# # remake the compilation +# re: fclean all +# +# .PHONY: clean fclean + + + + + + + + + + + + + + + + # Make a des built-in pattern rules : # https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html # par exemple pour construire des .o a partir de .c @@ -532,3 +660,84 @@ re: fclean all # the target, and if so execute the recipes + + +# NAME = fdf +# CC = gcc -g3 +# SRCDIR = srcs +# INCLUDESDIR = includes +# LIBFTDIR = libft +# VPATH = $(INCLUDESDIR) \ +# $(SRCDIR) \ +# $(SRCDIR)/init \ +# $(SRCDIR)/print \ +# $(SRCDIR)/calcul \ +# $(SRCDIR)/projection/isometrique \ +# $(SRCDIR)/projection/parallel \ +# $(SRCDIR)/parser \ +# $(SRCDIR)/loop_and_event +# LIBFT = $(LIBFTDIR)/libft.a +# INCLUDES = fdf.h \ +# init.h \ +# print.h \ +# calcul.h \ +# projection.h \ +# parser.h \ +# loop.h +# SRCS = main.c \ +# create_header.c \ +# create_map.c \ +# color_map.c \ +# color_line.c \ +# color_map_pixel.c \ +# print_3d.c \ +# create_mapping.c \ +# straight_line.c \ +# add_point.c \ +# quadrant_one.c \ +# quadrant_two.c \ +# quadrant_three.c \ +# get_points.c \ +# zoom.c \ +# shift.c \ +# alpha_omega.c \ +# increase_z.c \ +# key_dispatcher.c \ +# set_new_color.c \ +# set_projection.c +# ODIR = objs/ +# OBJS = $(addprefix $(OBJDIR), $(SRCS:.c=.o)) +# INC = -I $(INCLUDESDIR) -I $(LIBFTDIR)/$(INCLUDESDIR) +# all: +# @$(MAKE) -C $(MLX_DIR); +# @$(MAKE) -C $(LIBFTDIR) +# @$(ECHO) "$(FLAGS_COLOR)Compiling with flags $(CFLAGS) $(EOC)" +# @$(MAKE) $(NAME) +# debug: +# @$(MAKE) re DEBUG=1 +# $(LIBFT): +# @$(MAKE) -C $(LIBFTDIR) +# $(NAME): $(LIBFT) $(OBJDIR) $(OBJECTS) +# @$(CC) -o $@ $(OBJECTS) $(CFLAGS) $(LFLAGS) $(MLX_LIB) +# @$(ECHO) "$(OK_COLOR)$(NAME) linked with success !$(EOC)" +# $(OBJDIR): +# @$(MKDIR) $@ +# $(OBJDIR)%.o: $(SRC_DIR)%.c $(INCLUDES) +# @$(CC) -c $< -o $@ $(CFLAGS) +# @$(ECHO) "${COMP_COLOR}$< ${EOC}" +# clean: +# @$(MAKE) clean -C $(MLX_DIR) +# @$(MAKE) clean -C $(LIBFTDIR) +# @$(RM) $(OBJECTS) +# @$(RM) -r $(OBJDIR) && $(ECHO) "${OK_COLOR}Successfully cleaned $(NAME) objects files ${EOC}" +# fclean: clean +# @$(MAKE) fclean -C $(MLX_DIR) +# @$(MAKE) fclean -C $(LIBFTDIR) +# @$(RM) $(NAME) && $(ECHO) "${OK_COLOR}Successfully cleaned $(NAME) ${EOC}" +# re: fclean all +# rere: +# @$(RM) $(OBJECTS) +# @$(RM) -r $(OBJDIR) +# @$(RM) $(BINDIR)/$(NAME) +# @$(MAKE) all +# .PHONY: all clean fclean re debug diff --git a/test/.Makefile.swp b/test/.Makefile.swp deleted file mode 100644 index 86996582261e7fb76cf8c92603d27ade32b1f51d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&Jx&5a6bJB!g$aex=mo|P5-FJF!vsR4K~02&NHo$}4CAhBTv%LYqc&Q41drhb z^a9#=0b9L>Z)7R7prIoEC;2n`X5LITzm7mR-)Xc&MHYz13eo4++gbCK=x~v!7YC|; zYd5A3w-l9!g}mG;N-vtydN;n%3H+{S9OI6R(^8kN=LhbTQ`mw41ZEb9jhCw|QK?wS z+q*V5*2UWD>CD&S0ti3=0uX=z1Rwwb2tZ(d1k5l+_x!pG$t$OmIrV2wN=y)d00bZa z0SG_<0uX=z1Rwwb2+W~?IwvYG6J2xc@BfqU{~uhxb6z;loF~pB=Yey>vHe#Z&FOI3 z91I9R00Izz00bZa0SG_<0uX?}zY$1ZXf5dHGpEJYE@gff3BY(gKCr!i z(9R}D>~<*ZALV)dsNT$yeXdRl;w4ez>g0H@Ds@eUS>n^YWZPtqc%6&B@&|nLFgCiU PB7QQF8jQR!>Pt=EndneJ diff --git a/test/Makefile b/test/Makefile index 6596621..280bff1 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,9 +1,33 @@ -SRC = main.c putchar.c transform.c -DEP = test.h -OBJ = $(SRC:.c=.o) +#-------------# +# VARIABLES # +#-------------# +NAME = test +CC = gcc +VPATH = srcs +# HEADERS # +IDIR = includes +_DEPS = test.h +DEPS = $(_DEPS:%.h=$(IDIR)/%.h) +# LIBRAIRIES # +LDIR = ./ +_LIBS = libtest.a +LIBS = $(_LIBS:lib%.a=%) +# FUNCTIONS et OBJETS # +SRCS = main.c #putchar.c transform.c +ODIR = ./builds +OBJS = $(SRCS:%.c=$(ODIR)/%.o) +# OPTIONS de GCC # +CFLAGS = -I$(IDIR) +LFLAGS = -L$(LDIR) -l$(LIBS) -test: $(OBJ) - gcc -I. -o test $(OBJ) -%.o: %.c $(DEP) - gcc -I. -c $< +#---------# +# RULES # +#---------# +all: $(ODIR) $(NAME) +$(NAME): $(OBJS) $(DEPS) + $(CC) $(CFLAGS) -o test $(OBJS) $(LFLAGS) +$(ODIR): + mkdir -p $@ +$(ODIR)/%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< diff --git a/test/main.o b/test/builds/main.o similarity index 100% rename from test/main.o rename to test/builds/main.o diff --git a/test/test.h b/test/includes/test.h similarity index 100% rename from test/test.h rename to test/includes/test.h diff --git a/test/libtest.a b/test/libtest.a index e312c0d7b3912fdcf636562d09a815f3100ace4e..d07faf379996509a80486812e3657d6e627c1a8e 100644 GIT binary patch delta 40 pcmcb>bAe}q44b*Jxq+q0M5QWL5X)@i!oy4u)Km;my^3)TPt delta 42 tcmcb>bAe}q46Bi$nUTT7g%T4jlR<0)2Zp86m*c)6hA03wW zca&+VSVte3CD8qdpk`q9eC~!$-z##=zvnwvrEL|rR6k{D5u<7?aTi<#^Ji%;5D5Xf zRPqUg=sPSch&WIB4#*sGR#T<^9Zv1Zt37%*+vBeX=`op(tt?meZJfPHAA4eb+M_4) z{IS$ky?;J-DV@(K-ncp;BQXtgsa8)>wTaw1m}Uj^|IvQayr~>Cs&WX}08yTABUa^t aWmyy&h$V{;?nWHMk?T7l@i6Q~9{m6d|3u;d diff --git a/test/main.c b/test/srcs/main.c similarity index 100% rename from test/main.c rename to test/srcs/main.c diff --git a/test/putchar.c b/test/temp/putchar.c similarity index 100% rename from test/putchar.c rename to test/temp/putchar.c diff --git a/test/transform.c b/test/temp/transform.c similarity index 75% rename from test/transform.c rename to test/temp/transform.c index 36b8f0d..744c097 100644 --- a/test/transform.c +++ b/test/temp/transform.c @@ -2,5 +2,5 @@ int transform(int a) { - return(--a); + return (--a); } diff --git a/test/test b/test/test index b5322265e5aec77c5ce693c8bc9901bdb395f7b1..e8415bc3b952cfb8aee3c5e6e99f32b45711875a 100755 GIT binary patch delta 353 zcmX@%bi!%E1wjUW1_nk328LcB27`$Y?FIXwf^1N+zR8A+_LCJDIXI=DB2y+eGTIAn zfU5I=if-6^k&&NCK-ayuWh$S^$sOu}35=`t1tx!BwqRt~tjThnYq9{pl%Nt&d8g}- zZr2|j2l@B?d|@=%nqP8q3%>xJmJ4;4N$lW+3tGp^YzDBvJapH>oIP+F3lkyymwSW=XjSDcn# zl*{181XRb&FhLGTTmTUb@<0I~m>}n10HQ(i{EPx1COA;Uz+L^w1_nlE1|R{%EI_;i#83cYAdm!N3lJX%sDO&!fU1GtHx zttf%8A^Z^6h!6xH#u9-tK<0tm0tYM%4RAJ)5g(tNpIeZaToPZJSDu-d5+Cp5f-Elq z>Lw-s#JiQWq^3ae+Yo7V{qgX fXk&8bWkWI?sGJRCFh8>C@g+rxdBth@MY#+BMln04 From 848931d53767b282f379807560b606ea3dbf7fef Mon Sep 17 00:00:00 2001 From: Hugo LAMY Date: Fri, 15 Nov 2019 19:39:02 +0100 Subject: [PATCH 4/4] explicaiton des makefiles presque fini --- .DS_Store | Bin 6148 -> 6148 bytes Makefile | 324 +++++++++++++++++++++++++++++++------ test/Makefile | 4 +- test/builds/main.o | Bin 728 -> 780 bytes test/builds/to_uppercase.o | Bin 0 -> 632 bytes test/includes/test.h | 1 + test/srcs/main.c | 3 +- test/srcs/to_uppercase.c | 7 + test/test | Bin 8520 -> 0 bytes 9 files changed, 289 insertions(+), 50 deletions(-) create mode 100644 test/builds/to_uppercase.o create mode 100644 test/srcs/to_uppercase.c delete mode 100755 test/test diff --git a/.DS_Store b/.DS_Store index c5effae810f6131b3bdaf6c24b66dc4cc767dfec..3112e2f31ebdbe23cc2ba982599557781cbd25d8 100644 GIT binary patch delta 107 zcmZoMXfc@J&&ahgU^gQp*JK_hQ&kQIUxq}6Y=%^ZG=@xu9EMcSoc!dZoctsP1_l8j qUdh0~$g$asshm-ng`otfteBw$O^G!~$$v1|ypfrmWiva+Uw!~pMI0gk delta 36 scmZoMXfc@J&&aVcU^gQp$7CKR)6IoUIgFddI0RWHHh6Ak=lIJH0K`)YjsO4v diff --git a/Makefile b/Makefile index f5dc3cc..a48f294 100644 --- a/Makefile +++ b/Makefile @@ -80,15 +80,14 @@ SRCS = ft_atoi.c \ ODIR = ./builds -# - "addprefix" is a built-in expansion function used by -# makefile to perform a transformation on file names, in -# this case we want to put all the .o files in a -# subdirectory named "build" -# - $(SRCS:.c=.o) is a "substitute reference", an -# abbreviation for the expansion function "patsubst" : -# $(patsubst %.c,%.o,$(SRCS)) -OBJ = $(addprefix $(ODIR)/, $(SRCS:.c=.o)) - +# - $(SRCS:%.c=$(ODIR)/%.o) is a built-in function called a +# "substitute reference", an abbreviation for the +# expansion function "patsubst" : +# $(patsubst %.c,$(ODIR)/%.o,$(SRCS)) +# - % match everything, the value of the first % in +# "replacement" is replaced by the text matched by the +# first one in "pattern", it only works for the firsts +OBJ = $(SRCS:%.c=$(ODIR)/%.o) # - - - - - - - - - - - # # rules to execute # @@ -468,76 +467,307 @@ re: fclean all # makefile basique # - - - - - - - - - -# exemple d'un makefilede basic qui sert a creer un -# executable pour un programme : +# exemple for a basic makefile : # -# [archtecture] +# [architecture] # # main.c # # function01.c # # function02.c # # header.h +# # libtest.a # # Makefile # # [Makefile] -# # # DECLARATION VARIABLES -# # -# # NAME = bin_output +# # #-------------# +# # # VARIABLES # +# # #-------------# +# # NAME = program_test # # CC = gcc -# # CFLAGS = -I. -c +# # CFLAGS = -I. +# # LFLAGS = -L. -ltest # # DEPS = header.h # # SRCS = main.c \ # # function01.c \ # # function02.c # # ODIR = ./builds -# # OBJS = $(addprefix $(ODIR)/, $(SRCS:.c=.o)) +# # OBJS = $(SRCS:%.c=%.o) # # -# # -# # # RULES TO EXECUTE -# # +# # #---------# +# # # RULES # +# # #---------# # # all: $(ODIR) $(NAME) -# # $(NAME): $(OBJ) -# # ar -rc $@ $< -# # #clean: +# # $(NAME): $(OBJS) $(DEPS) +# # $(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS) +# # %.o: %.c +# # $(CC) $(CFLAGS) -c -o $@ $< +# # clean: # # /bin/rm -rf $(ODIR) # # fclean: clean # # /bin/rm -f $(NAME) # # re: fclean all # # .PHONY: all clean fclean re # -# apres avoir ecrit "make" dans le terminal le Makefile -# va s'executer et l'architecture du fichier racine sera -# un peu changee : +# # prompt "make" execute the first rule ("all") # # [archtecture] # # main.c # # main.o # # function01.c -# # function01.o +# # function01.o ++ # # function02.c -# # function02.o +# # function02.o ++ # # header.h +# # libtest.a # # Makefile -# # bin_output +# # program_test ++ # -# +# ----- # -# # - "addprefix" is a built-in expansion function used by -# # makefile to perform a transformation on file names, in -# # this case we want to put all the .o files in a -# # subdirectory named "build" -# # - $(SRCS:.c=.o) is a "substitute reference", an -# # abbreviation for the expansion function "patsubst" : -# # $(patsubst %.c,%.o,$(SRCS)) -# OBJ = $(addprefix $(ODIR)/, $(SRCS:.c=.o)) -# -# # - when you write "make" in command line it will execute -# # the first rule wrote in the Makefile, wich is "all" by -# # convention because usually when you type "make" you -# # expect it to build all -# # - it first verify if ODIR is created and if not create -# # it, then it calls NAME to create the library -# all: $(ODIR) $(NAME) -# +# shape of a rule : +# +# target: prerequisites ... +# recipe ... +# +# when a target is called, its execution depends of the +# prerequisites, if they have been more recently modify +# than the target the makefile execute the recipe +# +# to execute a rull you have to call it's name with make : +# "make rule", and by default the first rule is execute +# +# ----- +# +# "automatic variables" +# +# $@ is the name of the target that called the rule +# $< is the name of the first prerequisite +# $^ is the name of all the prerequisites +# +# ----- +# +# $(SRCS:%.c=%.o) +# +# is a built-in function called a "substitute reference", +# an abbreviation for the expansion function "patsubst" : +# +# $(patsubst pattern,replacement,text) +# $(text:pattern=replacement) +# +# $() is a variable which expand in its value +# +# % match everything, the value of the first % in +# "replacement" is replaced with the text matched by the +# first % in "pattern", it only works for the firsts +# +# ----- +# +# all: $(ODIR) $(NAME) +# +# ALL depends on ODIR and NAME, so if ODIR doesn't exist +# it will be created, and then NAME is called +# +# ----- +# +# $(NAME): $(OBJS) $(DEPS) +# $(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS) +# +# NAME depends on OBJS and DEPS, so if any .o or any .h +# have more recent date of modification NAME will execute +# only for them +# +# ----- +# +# %.o: %.c +# $(CC) $(CFLAGS) -c -o $@ $< +# +# when $(OBJS) expand in the list of .o files at the call +# of the NAME rule, each of them call the rule "%.o" wich +# depends on the equivalent .c, so if one has been +# modified since last execution of ALL, it's recompiled in +# object file with use of automatic variables $@ and $< +# +# ----- +# +# #clean: +# /bin/rm -rf $(ODIR) +# +# "make clean" suppress all the .o files +# +# ----- +# +# fclean: clean +# /bin/rm -f $(NAME) +# +# "make fclean" call CLEAN and suppress the executable +# +# ----- +# +# re: fclean all +# +# "make fclean" basically rerun make +# +# ----- +# +# .PHONY: all clean fclean re +# +# a phony target is one that is not the name of a file +# if a file called "clean" for instance exist, the rule +# CLEAN will never be executed when prompt "make clean" +# because it will be considered up to date, but if it's +# declared to be phony it will be executed in any case + +# - - - - - - - - - - - - - - - +# makefile with subdirectories +# - - - - - - - - - - - - - - - + +# put the .o in a "builds/" directory +# +# have the .c in a "srcs/" directory +# +# have the .h in an "includes" directory +# +# have multiples .a files +# +# [archtecture] +# # srcs/ +# # main.c +# # function01.c +# # function02.c +# # includes/ +# # header01.h +# # header02.h +# # libtest.a +# # liboption.a +# # Makefile +# +# # #-------------# +# # # VARIABLES # +# # #-------------# +# # NAME = program_test +# # CC = gcc +# # VPATH = srcs +# # +# # IDIR = includes +# # _DEPS = header01.h \ +# # header02.h +# # DEPS = $(_DEPS:%.h=$(IDIR)/%.h) +# # +# # LDIR = ./ +# # _LIBS = libtest.a \ +# # liboption.a +# # LIBS = $(_LIBS:lib%.a=%) +# # +# # SRCS = main.c \ +# # function01.c +# # function02.c +# # ODIR = ./builds +# # OBJS = $(SRCS:%.c=$(ODIR)/%.o) +# # +# # CFLAGS = -I$(IDIR) +# # LFLAGS = -L$(LDIR) -l$(LIBS) +# # +# # #---------# +# # # RULES # +# # #---------# +# # all: $(ODIR) $(NAME) +# # $(NAME): $(OBJS) $(DEPS) +# # $(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS) +# # $(ODIR): +# # mkdir -p $@ +# # $(ODIR)/%.o: %.c +# # $(CC) $(CFLAGS) -c -o $@ $< +# # clean: +# # /bin/rm -rf $(ODIR) +# # fclean: clean +# # /bin/rm -f $(NAME) +# # re: fclean all +# # .PHONY: all clean fclean re +# +# # prompt "make" execute the first rule ("all") +# +# [archtecture] +# # srcs/ +# # main.c +# # function01.c +# # function02.c +# # includes/ +# # header01.h +# # header02.h +# # builds/ +# # main.o +# # function01.o +# # function02.o +# # libtest.a +# # liboption.a +# # Makefile +# # program_test +# +# ----- +# +# LIBS = $(_LIBS:lib%.a=%) +# +# from "libtest.a" abd "liboption.a" it creates "test" +# and option +# +# as said, the value of the % in "replacement" is +# replaced with the text matched by the % in "pattern" +# +# ----- +# +# OBJS = $(SRCS:%.c=$(ODIR)/%.o) +# +# creates the list of .o from the .c with addition of the +# path directory "builds/main.o" +# +# ----- +# +# all: $(ODIR) $(NAME) +# $(ODIR): +# mkdir -p $@ +# +# ALL call the rull ODIR wich verify if the objects files +# directory already exist and if not, create it +# +# ----- +# +# $(NAME): $(OBJS) $(DEPS) +# $(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS) +# +# NAME depends on OBJS and DEPS, so if any .o or any .h +# have more recent date of modification NAME will execute +# only for them +# +# ----- +# +# clean: +# /bin/rm -rf $(ODIR) +# +# "make clean" suppress all the .o files +# +# ----- +# +# +# +# +# +# +# +# +# +# +# + +# - - - - - - - - - - - - - - - - - - - +# makefile qui make un autre makefile +# - - - - - - - - - - - - - - - - - - - + + +# - - - - - - - - - - - - - - - +# makefile pour une librairie +# - - - - - - - - - - - - - - - + + + # # create the folder where all the .o files will be stored # $(ODIR): # mkdir -p $(ODIR) diff --git a/test/Makefile b/test/Makefile index 280bff1..6b0b884 100644 --- a/test/Makefile +++ b/test/Makefile @@ -13,7 +13,7 @@ LDIR = ./ _LIBS = libtest.a LIBS = $(_LIBS:lib%.a=%) # FUNCTIONS et OBJETS # -SRCS = main.c #putchar.c transform.c +SRCS = main.c to_uppercase.c #putchar.c transform.c ODIR = ./builds OBJS = $(SRCS:%.c=$(ODIR)/%.o) # OPTIONS de GCC # @@ -25,7 +25,7 @@ LFLAGS = -L$(LDIR) -l$(LIBS) #---------# all: $(ODIR) $(NAME) $(NAME): $(OBJS) $(DEPS) - $(CC) $(CFLAGS) -o test $(OBJS) $(LFLAGS) + $(CC) $(CFLAGS) -o $@ $(OBJS) $(LFLAGS) $(ODIR): mkdir -p $@ $(ODIR)/%.o: %.c diff --git a/test/builds/main.o b/test/builds/main.o index 8a91bcf5ec6123301d0efa883e5a7535f2188f79..78735eff22a9fd6d79eba2dc35d483e9bee6fc4b 100644 GIT binary patch delta 221 zcmcb?+QT-%L2v~F1l(YR&?_be+KW0O39^%nMP&z+ehg3v{ZkDv)NLT*_q3C^vZ~lPzC-Nq&53K|yL!a$<2R F0|54kDa-%> delta 194 zcmeBSyTLlaL2w2G1l(YR&@(0m+KZYY39;TdVlUo_(8JQ+;WK^GgfRShN4MwHOtW0u@W|K9U%vC%7 hLjcTn21h=DHYR6YHmG@8K$>xKFO%`)3ru=I(*Uj@B0m5C diff --git a/test/builds/to_uppercase.o b/test/builds/to_uppercase.o new file mode 100644 index 0000000000000000000000000000000000000000..e8f61a51cded7bf9ae841a5fc1be8ea837d58db8 GIT binary patch literal 632 zcmX^A>+L^w1_nlE1|R{%EI_;i#83cYAdm!N3lJX%sDO&!fU1GtHx zttf%8A^Z^6h!6xH#u9}xK<0tm0tYM%4RAJ)5g(tNpIeZaToPZJSDu-d5+Cp5f-Elq zJYEg1xF))k){sug6 literal 0 HcmV?d00001 diff --git a/test/includes/test.h b/test/includes/test.h index 618baa2..c40b808 100644 --- a/test/includes/test.h +++ b/test/includes/test.h @@ -5,5 +5,6 @@ void ft_putchar(char c); int transform(int a); +int to_uppercase(int a); # endif diff --git a/test/srcs/main.c b/test/srcs/main.c index 45b5479..e096911 100644 --- a/test/srcs/main.c +++ b/test/srcs/main.c @@ -3,7 +3,8 @@ int main() { int a = 't'; + a = to_uppercase(a); a = transform(a); ft_putchar(a); - return (0); + return(0); } diff --git a/test/srcs/to_uppercase.c b/test/srcs/to_uppercase.c new file mode 100644 index 0000000..35d56ba --- /dev/null +++ b/test/srcs/to_uppercase.c @@ -0,0 +1,7 @@ +#include "test.h" + +int to_uppercase(int a) +{ + a -= 32; + return(a); +} diff --git a/test/test b/test/test deleted file mode 100755 index e8415bc3b952cfb8aee3c5e6e99f32b45711875a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8520 zcmeHNO=}ZD7@oCNi({j%Dw&V+F$j|YCQ7?5r z9gs2|-;U45c=m78{fWbTTqj|?v2I5$U%lcET@Kcq(=<sg)hM7V{dNP zcKr;i?LRBc_7vl`Y;5jquu;G$U=%P47zK<1MggOMQNSo*6fg=H1&jj!g#ukY_81fG zitzAI9fr#U&YN*~J?4p$@a(RLyz8a>Bmm8lIFE0YnHib9mz>P|Nt|`Z*?lk*Pi4gg z--~B+)3aViM5lc@m-i=U;-0v~?-MOzu^X4yynO0bY=}f0*4W-@)lMGy{b8TNLfp~c zBltC@lMNc