Jul 07 23:37:20 <_pjp_> well..we are almost through with the gcc options used in everyday life. Jul 07 23:38:08 cool Jul 07 23:39:01 <_pjp_> there are some more like -Wall, and -S, -g and -O etc. Jul 07 23:39:11 ! Jul 07 23:39:50 <_pjp_> but I was wondering whether to cover them now or not? Jul 07 23:40:15 ! Jul 07 23:40:21 _pjp_, go head Jul 07 23:40:24 <_pjp_> -g will be more clear when used with gdp Jul 07 23:40:27 <_pjp_> gdb Jul 07 23:40:31 <_pjp_> sunny_slls: ? Jul 07 23:40:37 i didn't understand that # define no 9 Jul 07 23:40:56 please explain with an example Jul 07 23:40:57 macro call Jul 07 23:41:03 sunny_slls, GO BACK AND READ YOUR C BOOK FIRST Jul 07 23:41:24 oops sorry i remembered Jul 07 23:41:33 munichlinux, please don't explain these simple things Jul 07 23:41:42 OK Jul 07 23:41:46 <_pjp_> sunny_slls: well, just write that line in your hello.c file and see the pre-processed output Jul 07 23:41:51 i thought it is a different thing Jul 07 23:42:11 * amrita_ (n=amrita@117.201.97.167) has joined #dgplug Jul 07 23:42:40 * amrita has quit (Nick collision from services.) Jul 07 23:42:47 * amrita_ is now known as amrita Jul 07 23:43:26 <_pjp_> okay..-Wall is used to enable *all* the compile time warning messages Jul 07 23:44:33 * samar (n=samar-ad@220.226.26.171) has joined #dgplug Jul 07 23:45:57 <_pjp_> Though C is a standardised language, the C standard leaves quite a few things open for user interpretation and/or implementation and does not clearly define what the course of events should result in. Jul 07 23:46:04 * techno_freak has quit ("Leaving") Jul 07 23:47:33 <_pjp_> For example, if you don't declare a function before it's use, some implementations do assume things and produce code accordingly..which may not be portable. Jul 07 23:49:17 <_pjp_> -Wall options gives you all such warning messages and millions of others, which at times are quite informative and do help extend your understanding of the C language. Jul 07 23:49:49 <_pjp_> The -O option is used to specify the code optimisation level Jul 07 23:51:15 * susenj has quit (Read error: 110 (Connection timed out)) Jul 07 23:51:26 ! Jul 07 23:51:30 * karunakar has quit ("Leaving") Jul 07 23:51:34 ! Jul 07 23:51:48 <_pjp_> gcc supports different optimisation levels, which offer different optimisation while generating the final code Jul 07 23:51:54 <_pjp_> amrita: susen1? Jul 07 23:51:54 * Subhodip has quit ("Leaving") Jul 07 23:52:00 what is here? Jul 07 23:52:05 Jul 07 23:52:16 <_pjp_> susen1: is an integer number Jul 07 23:52:32 _pjp_, code optimasation means? Jul 07 23:52:36 <_pjp_> one can say $ gcc -O1 hello.c Jul 07 23:52:47 *optimisation Jul 07 23:53:04 _pjp_,1 means?? Jul 07 23:53:57 * rtnpro has quit (Read error: 110 (Connection timed out)) Jul 07 23:54:17 * Kkhushi (n=khushbu@59.180.151.45) has left #dgplug ("Ex-Chat") Jul 07 23:54:32 <_pjp_> code optimisation is, while generating binary code for macros, or loop statements, or pointer/string operations, gcc can produce more efficient/faster code Jul 07 23:54:42 <_pjp_> gcc is quite an intelligent program that way. Jul 07 23:55:17 true :) Jul 07 23:55:46 <_pjp_> susen1: 1 is first level optimisation, it tries to generate faster code. Jul 07 23:56:13 <_pjp_> please see man gcc for more information about each level. Jul 07 23:56:25 _pjp_,ok Jul 07 23:56:34 <_pjp_> it's kind of difficult to type all that here. Jul 07 23:56:55 * susenj (n=chatzill@59.178.170.98) has joined #dgplug Jul 07 23:57:20 #systemtap Jul 07 23:57:29 oops.. sorry Jul 07 23:57:31 * susen1 (n=student@59.178.170.98) has left #dgplug Jul 07 23:58:39 <_pjp_> then..which else..ah there -g and -p Jul 07 23:59:11 <_pjp_> these options are more suitable for debugging your program with the external tools like gdb and gprof Jul 08 00:00:10 <_pjp_> they each insert extra information in the executable files, which can be used later while debuggin. Jul 08 00:00:52 <_pjp_> say: gcc -g hello.c Jul 08 00:00:55 * samar has quit ("Ex-Chat") Jul 08 00:01:12 <_pjp_> and check the file-size difference for yourself. Jul 08 00:02:55 <_pjp_> then -S options is used to produce the compilation output in an assembly language, ie. a step just before the code generation Jul 08 00:03:05 <_pjp_> say: $ gcc -S hello.c Jul 08 00:03:16 <_pjp_> and you'll get a file called hello.s Jul 08 00:03:51 <_pjp_> that's how your hello.c looks like in assembly language Jul 08 00:04:47 <_pjp_> these assembly instructions are then converted to the machine codes and also the linking information is inserted to produce the binary file. Jul 08 00:05:02 <_pjp_> so far..with me? Jul 08 00:06:00 ya Jul 08 00:06:04 yes Jul 08 00:06:10 yes Jul 08 00:06:20 yup Jul 08 00:08:04 <_pjp_> okay, I guess that's pretty much what is used while doing *general* day-to-day C programming Jul 08 00:10:10 <_pjp_> other options are quite advanced and are used when working with different architectures and/or embedded system etc. Jul 08 00:10:27 <_pjp_> Which I think are not required here. Jul 08 00:11:02 * ria (n=ria@219.64.67.135) has joined #dgplug Jul 08 00:12:13 <_pjp_> Now, since we are talking about compilation, it Jul 08 00:13:01 <_pjp_> it makes sense to cover Make first than gdb Jul 08 00:13:14 <_pjp_> is that okay with all? Jul 08 00:15:40 _pjp_, go ahead Jul 08 00:16:22 * Soumya has quit ("ChatZilla 0.9.83 [Firefox 3.0/2008052906]") Jul 08 00:16:50 i am actually waiting for make :) Jul 08 00:16:58 <_pjp_> right..okay Jul 08 00:17:55 <_pjp_> The makefile is used to define how a project should be compiled. Jul 08 00:19:54 <_pjp_> Make has some really cool benefits which are inherent because of the way it works Jul 08 00:20:12 * susen1 (n=student@59.178.170.98) has joined #dgplug Jul 08 00:21:21 * susen1 has quit (Client Quit) Jul 08 00:21:43 <_pjp_> What it does is, it conditionally(based on timestamps) compiles only those source files which require compilation and leaves the others. Jul 08 00:21:45 * susenj (n=chatzill@59.178.170.98) has left #dgplug Jul 08 00:22:28 * susenj (n=student@59.178.170.98) has joined #dgplug Jul 08 00:23:50 <_pjp_> which means shorter compilations times, it saves you from typing the long commands on the shell prompt, and also gives you some handy options like clean and dist and etc. Jul 08 00:24:14 <_pjp_> So, let's write our first Makefile, and then I'll explain the details. Jul 08 00:26:41 <_pjp_> hey kushal what's that rbfp.net/paste site? Jul 08 00:26:57 <_pjp_> kushal: ? Jul 08 00:27:07 _pjp_, rafb.net/paste Jul 08 00:27:24 <_pjp_> oh..thanks Jul 08 00:28:07 <_pjp_> wait a min guys.. Jul 08 00:32:08 * amrita_ (n=amrita@117.201.96.252) has joined #dgplug Jul 08 00:32:30 * amrita has quit (Nick collision from services.) Jul 08 00:32:36 * amrita_ is now known as amrita Jul 08 00:34:54 * amrita_ (n=amrita@117.201.96.252) has joined #dgplug Jul 08 00:34:59 * amrita_ has quit (Client Quit) Jul 08 00:39:06 sorry...class paused? Jul 08 00:39:46 susenj, nope, wait for _pjp_ Jul 08 00:39:54 * susenj_ (n=chatzill@59.178.170.98) has joined #dgplug Jul 08 00:40:01 * susenj_ (n=chatzill@59.178.170.98) has left #dgplug Jul 08 00:40:53 kushal,okay !i thought my pidgin crashed Jul 08 00:40:53 <_pjp_> yes, 1 sec Jul 08 00:41:33 susenj, :) Jul 08 00:42:12 <_pjp_> please see: http://rafb.net/p/NpvgTu50.html Jul 08 00:44:20 <_pjp_> okay..create a file named Makefile or makefile from that link in the directory where you have your hello.c and greet.c sources. Jul 08 00:45:14 <_pjp_> I suggest you type it instead of just copy/paste and tell me when you're done. Jul 08 00:45:44 _pjp_, tell them about tab Jul 08 00:46:02 <_pjp_> kushal: yes, let them finish first. Jul 08 00:46:31 ok:) Jul 08 00:47:30 _pjp_, done Jul 08 00:47:39 <_pjp_> okay Jul 08 00:48:06 pjp,! Jul 08 00:48:11 <_pjp_> sunny_slls: ? Jul 08 00:48:34 how i will do it in windows Jul 08 00:48:44 <_pjp_> sunny_slls: windows? Jul 08 00:49:49 how i will makefile in windows? Jul 08 00:49:50 sunny_slls, fist format C drive then install Linux , then you can do that Jul 08 00:50:01 lol Jul 08 00:50:03 :) Jul 08 00:50:05 lol Jul 08 00:50:14 <_pjp_> :) Jul 08 00:50:17 that was awesome! Jul 08 00:50:27 kushal, i was about to say that Jul 08 00:51:03 <_pjp_> sunny_slls: they do have make in Windows, but I really don't have much idea about it. Jul 08 00:51:14 ok Jul 08 00:51:16 sunny_slls, you have to wait, copy the whole session log to your linux partition and try there Jul 08 00:51:21 bad luck Jul 08 00:51:43 <_pjp_> okay..I think all are done. Jul 08 00:52:14 atleast show me the example Jul 08 00:52:53 <_pjp_> So as you can see, makefile is nothing but a plain text file containing the same shell commands we used earlier to compile our hello.c, isn't it? Jul 08 00:53:01 <_pjp_> sunny_slls: what example? Jul 08 00:53:02 ! Jul 08 00:53:05 <_pjp_> ria: ? Jul 08 00:53:27 i joined late, so could not follow the earlier discussion Jul 08 00:53:43 can i start from creating the file makefile Jul 08 00:53:44 <_pjp_> ria: well..I'm sorry. Jul 08 00:53:44 ? Jul 08 00:53:53 <_pjp_> ria: sure you can Jul 08 00:53:55 sunny_slls, he gave the example Jul 08 00:54:19 was confused i will understand or not Jul 08 00:54:23 ok thanks Jul 08 00:54:26 Jul 08 00:54:32 * bose_ (n=aritra@117.201.96.74) has joined #dgplug Jul 08 00:55:12 ! Jul 08 00:55:32 <_pjp_> So, the first section of the makefile defines some variables, that must be intuitive, right? Jul 08 00:55:35 <_pjp_> ria: ? Jul 08 00:55:37 why is this file makefile written? Jul 08 00:55:53 <_pjp_> I did explain it before. Jul 08 00:55:58 ria, scroll back Jul 08 00:56:08 <_pjp_> will cover up later again if need be. Jul 08 00:56:23 ok Jul 08 00:56:24 <_pjp_> now let's just go forward?! Jul 08 00:57:25 <_pjp_> The SHELL and CC variables are declared because they defines exactly which shell and which compiler to use Jul 08 00:57:31 * bose_aritra has quit (Read error: 110 (Connection timed out)) Jul 08 00:58:49 <_pjp_> the /bin/sh is suppose to be the most portable and thus widely available shell today Jul 08 00:59:17 <_pjp_> though, on most of the systems today it's a symbolic link to bash(1) Jul 08 01:00:26 <_pjp_> bash is really incredibly powerful.. Jul 08 01:01:15 <_pjp_> okay, this variable declaration is optional, and not necessary always. Jul 08 01:02:14 <_pjp_> next observe the line hello: hello.o greet.o Jul 08 01:02:54 <_pjp_> This line as two parts, one before the colon(:) and one after the colon(:) Jul 08 01:03:09 <_pjp_> oops..that was `:' Jul 08 01:03:50 <_pjp_> The part before the colon <:> character is called `target' Jul 08 01:04:20 <_pjp_> The part after the colon<:> character is called `dependencies'. Jul 08 01:04:51 <_pjp_> ie. the target depends on the dependencies. Jul 08 01:05:46 <_pjp_> so, when any one of the dependencies change, the target is recompiled by make Jul 08 01:06:28 <_pjp_> The line immediately following the above is the actual shell command used by make to create the target Jul 08 01:07:12 <_pjp_> ie. to create executable hello from hello.o and greet.o make uses the command $(CC) -o hello hello.o greet.o $(LIBS) Jul 08 01:07:28 <_pjp_> everybody with me? Jul 08 01:07:54 go head Jul 08 01:08:25 <_pjp_> great.. Jul 08 01:09:01 http://sources.redhat.com/autobook/download.html this is good Jul 08 01:09:49 <_pjp_> the important thing to note/remember here is that, the line containing command *must always* begin with a tab(\t) character. Jul 08 01:10:14 <_pjp_> That's just the make syntax Jul 08 01:12:23 <_pjp_> the Make starts reading makefile from the top(unless if the target is specified on the command line) and executes the command for the first target it sees. Jul 08 01:12:43 <_pjp_> unless of-course it's dependencies are accessible. Jul 08 01:16:29 * Debashree has quit ("Leaving") Jul 08 01:16:57 <_pjp_> So now when you say `$ make' on the command line, make starts reading our Makefile, and encounters the target hello:, but to create hello you need hello.o and greet.o, so then make goes ahead and tries to find out how to create hello.o and greet.o Jul 08 01:17:45 <_pjp_> for which rules are defined right below the hello: rules Jul 08 01:18:05 * Debashree (n=Debashre@61.2.164.108) has joined #dgplug Jul 08 01:18:53 <_pjp_> Oh btw, the sequence of target: <\n\t>command(s) is called a make rule. Jul 08 01:21:09 <_pjp_> the dependencies are optional, as you can see for clean: Jul 08 01:21:58 <_pjp_> one can specify the particular target on the command line with the make Jul 08 01:22:03 <_pjp_> as $ make clean Jul 08 01:22:30 <_pjp_> it will wipe out all the object files and executable files from the respective directories. Jul 08 01:22:46 <_pjp_> In our case, same as the source directory. Jul 08 01:23:05 <_pjp_> Now, let's play around with this a bit. Jul 08 01:23:50 <_pjp_> just type $ make Jul 08 01:24:08 <_pjp_> you Jul 08 01:24:21 <_pjp_> you'll see how make executes the commands. Jul 08 01:24:44 <_pjp_> first it creates the hello.o, then greet.o and then finally hello Jul 08 01:24:55 ! Jul 08 01:25:00 <_pjp_> ria: ? Jul 08 01:25:38 [ria@rialappy c]$ make Jul 08 01:25:39 makefile:6: *** missing separator. Stop. Jul 08 01:25:43 what is it? Jul 08 01:26:21 <_pjp_> I think you missed the \t on near line 6 Jul 08 01:26:58 ok let me check Jul 08 01:27:22 _pjp_, me too getting same thing but on line 8 Jul 08 01:27:45 _pjp_, line 6 is a blank line Jul 08 01:27:55 * munichlinux has quit ("Ex-Chat") Jul 08 01:27:57 _pjp_, should i put /t over there? Jul 08 01:28:29 <_pjp_> folks remember that the line containing command *must* begin with the tab(\t) character. Jul 08 01:28:33 * sunny_slls has quit ("Leaving") Jul 08 01:28:49 <_pjp_> I did tell you not to copy/paste it Jul 08 01:29:15 _pjp_, even i cannot see /t in your code Jul 08 01:29:24 *\t Jul 08 01:29:51 * sunny_slls (i=Sunny@117.99.54.17) has joined #dgplug Jul 08 01:30:08 ria,just press tab and that's it Jul 08 01:30:30 susenj, ok Jul 08 01:30:45 _pjp_, indentation is ok but Jul 08 01:30:53 <_pjp_> well of-course `\t' is a C escape sequence character, you won't see it there Jul 08 01:31:07 ! Jul 08 01:31:09 ok i did not understand Jul 08 01:31:21 _pjp_, my indentation is ok Jul 08 01:31:32 <_pjp_> generally it's same as a sequence of 8 spaces, but not the same. Jul 08 01:31:59 ya that i already corrected at the beginning Jul 08 01:32:40 <_pjp_> go to the beginning of the line and hit the tab key Jul 08 01:33:02 * Debashree_ (n=Debashre@61.2.165.154) has joined #dgplug Jul 08 01:33:20 i went and this time pressed with 8 spaces Jul 08 01:34:18 again i did with tabs after going at the beginning Jul 08 01:34:26 still the same error _pjp_ Jul 08 01:34:37 <_pjp_> susenj: ? Jul 08 01:34:43 i didn't understand this #make clean part Jul 08 01:34:52 * sunny_slls has quit ("Leaving") Jul 08 01:35:04 <_pjp_> ria: no, 8 spaces is *not* same as tab Jul 08 01:35:15 ria,first delete all the spaces and then do the same thing ,as _pjp_told Jul 08 01:35:26 _pjp_, ya its equal to 2 Jul 08 01:35:39 _pjp_, i did with one tab still the same Jul 08 01:36:15 <_pjp_> susenj: well..that directly invokes the clean target Jul 08 01:36:24 <_pjp_> ria: what is 2 Jul 08 01:37:03 _pjp_,okay,i will try to explore it Jul 08 01:37:07 _pjp_, wait check it http://rafb.net/p/zGzFh811.html Jul 08 01:37:09 <_pjp_> if you have set the `expand tab(et)' option of vim then you'll have to use the Crtl+v+tab combination Jul 08 01:37:37 _pjp_, this is my code, is it ok? Jul 08 01:38:13 <_pjp_> ria: well..it's looks okay..but still check for tabs Jul 08 01:38:36 <_pjp_> ria: I can not really tell even if I copy/paste it here. Jul 08 01:38:42 _pjp_, i think its ok, still checking Jul 08 01:39:17 <_pjp_> is everybody trying..? Jul 08 01:39:55 yes Jul 08 01:40:10 ria, show us the make file Jul 08 01:40:26 <_pjp_> kushal: there is the link above. Jul 08 01:40:28 kushal, scroll back Jul 08 01:40:56 got it Jul 08 01:41:21 ria, those are spaces, not tabs Jul 08 01:42:30 <_pjp_> if you are using vim, do / Jul 08 01:42:30 kushal,how did you identify that?? Jul 08 01:42:54 <_pjp_> search for tab characters as: /\t Jul 08 01:43:01 kushal, i pressed tab Jul 08 01:43:03 <_pjp_> it should highlight Jul 08 01:43:17 oh ....yes...got it Jul 08 01:43:26 _pjp_, will pressing tab not work? Jul 08 01:43:37 kushal, ^^^ Jul 08 01:44:09 <_pjp_> I told you, if you have `expand tab' set in vim, hitting tab key won't do Jul 08 01:44:21 <_pjp_> use Ctrl+v+tab combination Jul 08 01:44:35 susenj, see this http://rafb.net/p/mXZ8m738.html first line is tab , next line space Jul 08 01:45:16 Btw, whoever is not telling that his/her makefile is not working is a looser Jul 08 01:45:27 this is a session , you can ask here Jul 08 01:45:54 but if you don't tell here that your code is not working , then we can not help you Jul 08 01:45:57 kushal okay....you have pressed 9 apaces Jul 08 01:46:04 susenj, :) Jul 08 01:46:04 in second line Jul 08 01:46:04 _pjp_, still not working Jul 08 01:46:09 kushal, how can we differentiate by seeing tabs and spaces? Jul 08 01:46:19 _pjp_, i did ctrl+v+tab Jul 08 01:46:30 amrita, open the file in gedit Jul 08 01:46:44 there is a vi option , I just don't remember which one Jul 08 01:46:54 <_pjp_> amrita: that's not visibly intuitive Jul 08 01:47:11 <_pjp_> ria: press Ctrl+v and then tab key Jul 08 01:47:41 _pjp_, ya i did so Jul 08 01:47:53 http://rafb.net/p/TkjSyy74.html _pjp_ Jul 08 01:48:00 <_pjp_> kushal: vi is quite different that vim at times. Jul 08 01:48:03 ^^^the newer one Jul 08 01:48:10 I mean vim Jul 08 01:48:15 i never use vi Jul 08 01:48:52 ria, still they are spaces Jul 08 01:49:01 ria, open the file in gedit and try Jul 08 01:49:08 kushal, _pjp_ its working now Jul 08 01:49:29 <_pjp_> ria: great..congratulations! Jul 08 01:49:35 _pjp_, i did ctrl+v and then tab then i worked Jul 08 01:49:43 <_pjp_> ria: he..he..really? Jul 08 01:49:49 <_pjp_> :) Jul 08 01:49:54 _pjp_, :) Jul 08 01:50:05 its so critical with spaces Jul 08 01:50:14 ria,:) Jul 08 01:50:15 <_pjp_> hmmn... Jul 08 01:51:55 <_pjp_> try $ make clean as well Jul 08 01:52:36 done Jul 08 01:53:17 <_pjp_> okay..so now you see how rule are executed, I mean the sequence Jul 08 01:53:38 <_pjp_> I'm assuming it for everyone here. Jul 08 01:54:54 <_pjp_> now just say: $ touch hello.c and again $ make Jul 08 01:55:10 <_pjp_> see which commands are executed and which are not Jul 08 01:55:53 * Debashree has quit (Read error: 113 (No route to host)) Jul 08 01:56:13 greet.c is executed Jul 08 01:56:17 * Debashree_ is now known as Debashree Jul 08 01:56:39 <_pjp_> well, if you did tocuh greet.c Jul 08 01:57:02 i did touch hello.c Jul 08 01:57:12 <_pjp_> Only the files which are modified are(or should be) compiled again Jul 08 01:57:51 <_pjp_> so if you touch hello.c then hello.o is generated again, because hello.o is older than hello.c Jul 08 01:58:19 * bose_ has quit ("Leaving") Jul 08 01:58:29 <_pjp_> and because hello.o is generated again, the target hello is built again, as it depends on hello.o Jul 08 01:58:39 * bose_aritra (n=aritra@117.201.96.74) has joined #dgplug Jul 08 01:59:07 ! Jul 08 01:59:17 <_pjp_> ria: ? Jul 08 01:59:19 _pjp_, i get this http://rafb.net/p/gae3HC10.html Jul 08 02:00:05 <_pjp_> ria: you did $ make clean before touch Jul 08 02:00:24 what will it be then? Jul 08 02:00:55 <_pjp_> do $ make -> $ touch -> $make Jul 08 02:01:03 kushal ! Jul 08 02:01:11 amrita, yes Jul 08 02:01:16 _pjp_, ok Jul 08 02:01:23 kushal, its not comming Jul 08 02:01:28 <_pjp_> The whole intention of having make is to not having to recompile entire source tree again and again. Jul 08 02:01:31 kushal, did as ria Jul 08 02:01:51 amrita, show us the makefile Jul 08 02:02:03 ria, have you done same thing with line 15? Jul 08 02:02:35 amrita, yes i forgot to say you Jul 08 02:03:05 _pjp_, make does the same after doing $touch hello.c Jul 08 02:03:23 <_pjp_> ria: no, it should not compile greet.c again Jul 08 02:04:12 <_pjp_> ria: first time you see three output line, then second time only two should be there Jul 08 02:04:20 kushal, http://rafb.net/p/noWaK677.html Jul 08 02:04:23 _pjp_, earlier also greet.c was not compiled Jul 08 02:04:38 _pjp_, no first time also i see two Jul 08 02:04:38 <_pjp_> ria: why? Jul 08 02:04:52 <_pjp_> ria: check your makefile Jul 08 02:05:01 amrita, is it working ? Jul 08 02:05:08 kushal, no Jul 08 02:05:44 amrita, please change the spaces with only single tab Jul 08 02:05:56 ok Jul 08 02:05:59 but when i did the mistake of $make clean, and then $touch it showed me three Jul 08 02:06:20 kushal, http://rafb.net/p/ZZp1lM27.html Jul 08 02:06:26 kushal, the error before Jul 08 02:06:27 so i said you i see greet.c here which i did not see earlier _pjp_ Jul 08 02:07:27 amrita, that is a problem in the hello.c you can see that, try to fix that, your make file shows ok Jul 08 02:07:46 kushal, ok Jul 08 02:08:37 <_pjp_> ria: of-course that's the first time. And second is after you touch hello.c Jul 08 02:08:44 <_pjp_> so that's okay Jul 08 02:09:05 _pjp_, ya first time i got two Jul 08 02:09:16 <_pjp_> ria: three? Jul 08 02:09:22 _pjp_, when i did $make for the first time Jul 08 02:09:37 _pjp_, after that i did $make clean Jul 08 02:09:53 _pjp_, then i did touch hello.c Jul 08 02:10:02 <_pjp_> ria: yes, do it again, $ make clean -> $ make -> $ touch hello.c -> $ make Jul 08 02:10:10 _pjp_, which was a mistake Jul 08 02:10:20 kushal, http://rafb.net/p/4T0U1t12.html Jul 08 02:10:21 brb Jul 08 02:10:24 _pjp_, then i did make and got three Jul 08 02:10:38 _pjp_, ok Jul 08 02:10:43 amrita, now show me the latest makefile Jul 08 02:10:53 kushal, ok Jul 08 02:11:13 <_pjp_> guys shall we take the questions Jul 08 02:11:14 _pjp_, now its working fine Jul 08 02:11:20 <_pjp_> ria: great! Jul 08 02:11:34 _pjp_, but i wonder why it did not work earlier Jul 08 02:11:43 <_pjp_> well.. Jul 08 02:11:53 kushal, http://rafb.net/p/mhlkdi69.html Jul 08 02:12:34 [ria@rialappy c]$ make Jul 08 02:12:35 makefile:9: *** missing separator. Stop. Jul 08 02:12:35 [ria@rialappy c]$ vi makefile Jul 08 02:12:35 [ria@rialappy c]$ make Jul 08 02:12:35 /usr/bin/gcc -x c -ansi -c hello.c Jul 08 02:12:36 /usr/bin/gcc -o hello hello.o greet.o -lm Jul 08 02:12:55 ria, you ever heard about http://rafb.net/paste ? Jul 08 02:13:00 _pjp_, see this is the first time i did make and it gave me two results Jul 08 02:13:08 kushal, it was a smaller one Jul 08 02:13:38 <_pjp_> ria: because you did not touch/modify the C source/header file(s) Jul 08 02:13:40 ria, NO Jul 08 02:13:57 ria, use rafb if your paste is more than 2 lines Jul 08 02:14:04 _pjp_, ok that too needs to be modified Jul 08 02:14:24 amrita, ask _pjp_ , I can not figure out Jul 08 02:14:24 kushal, ok extremely sorry Jul 08 02:14:44 _pjp_, please Jul 08 02:15:41 <_pjp_> amrita: open your makefile in vim Jul 08 02:15:58 _pjp_, i have vi Jul 08 02:16:04 <_pjp_> then search for tab(\t) character as: /\t Jul 08 02:16:08 <_pjp_> say $ vim Jul 08 02:16:48 * arpita has quit (Read error: 110 (Connection timed out)) Jul 08 02:17:57 <_pjp_> amrita: ? Jul 08 02:18:11 _pjp_, i have done that Jul 08 02:18:47 <_pjp_> amrita: do you see the highlighted tab character Jul 08 02:18:51 <_pjp_> ? Jul 08 02:19:36 * susenj (n=student@59.178.170.98) has left #dgplug Jul 08 02:19:38 _pjp_, yes in red Jul 08 02:20:48 * amrita_ (n=amrita@117.201.96.252) has joined #dgplug Jul 08 02:20:53 * amrita_ has quit (Client Quit) Jul 08 02:21:09 <_pjp_> amrita: right? does the lines containing commands begin with the tab? Jul 08 02:21:48 _pjp_, i did contrl+v and then tab Jul 08 02:22:06 <_pjp_> okay, then? Jul 08 02:22:29 <_pjp_> amrita: do you have expand tab option set in vim? Jul 08 02:22:47 <_pjp_> amrita: you need Ctrl+v + tab only then Jul 08 02:23:06 _pjp_, i have vi not vim Jul 08 02:23:30 <_pjp_> amrita: say $ vim makefile Jul 08 02:25:28 <_pjp_> folks please try to do some C programming using all that we've covered so far Jul 08 02:25:30 <_pjp_> amrita: ? Jul 08 02:25:36 http://rafb.net/p/3i94gA27.html Jul 08 02:25:47 _pjp_, this is the error i am getting Jul 08 02:25:49 _pjp_, sure :) Jul 08 02:26:35 <_pjp_> You can write programs to find N-factorials, find perfect numbers below/upto n, sort an array, or find magic numbers upto/below n Jul 08 02:26:50 <_pjp_> where n is an input given by the user, etc Jul 08 02:27:09 _pjp_, now tell me what to do? Jul 08 02:28:14 * stephaniewhiting has quit ("ChatZilla 0.9.82.1 [Firefox 2.0.0.15/2008062306]") Jul 08 02:28:29 <_pjp_> amrita: do you have the file named hello3.h in the same directory? Jul 08 02:28:39 _pjp_, yes Jul 08 02:29:28 <_pjp_> amrita: it seems to be that make can not find that file there. Jul 08 02:29:37 _pjp_, i have hello.h not hello3.h Jul 08 02:30:08 _pjp_, but hello3.c Jul 08 02:30:10 <_pjp_> amrita: but your makefile says hello3.h not hello.h Jul 08 02:30:54 <_pjp_> amrita: $ mv hello.h hello3.h or change the makefile Jul 08 02:32:07 <_pjp_> amrita: ? Jul 08 02:32:30 http://rafb.net/p/ZGh1in55.html Jul 08 02:32:45 _pjp_, is it correct? Jul 08 02:32:56 <_pjp_> amrita: yes, congratulations. Jul 08 02:33:06 _pjp_, ohhh thanks Jul 08 02:33:15 <_pjp_> amrita: now say $make clean -> $make -> $ touch hello.c -> $ make Jul 08 02:33:40 <_pjp_> amrita: and tell me if you observe any difference Jul 08 02:34:33 http://rafb.net/p/V3h64T12.html Jul 08 02:34:47 <_pjp_> amrita: right Jul 08 02:35:33 _pjp_, but didn't understand the 2nd part Jul 08 02:35:53 * Kishan has quit ("Leaving") Jul 08 02:36:09 <_pjp_> amrita: you changed/touched hello.c, so second time there was no need to compile greet.c again, was there? Jul 08 02:37:40 _pjp_, ok Jul 08 02:38:50 _pjp_, will you teach anything more today? Jul 08 02:39:24 <_pjp_> okay guys and girls..please try to play around with gcc and make with some simple C programs of your choice, and see how you do. Jul 08 02:39:35 <_pjp_> amrita: no, it's quite late today. Jul 08 02:39:45 _pjp_, thanks Jul 08 02:40:06 kushal, are you there? Jul 08 02:40:07 <_pjp_> Will catch again on Wednesday/Thursday night, okay? Jul 08 02:40:12 <_pjp_> kushal: ? Jul 08 02:40:15 ok Jul 08 02:40:30 thanks _pjp_ Jul 08 02:40:48 kushal, my roll call Jul 08 02:40:57 ria, he he Jul 08 02:41:01 <_pjp_> okay then good night all Jul 08 02:41:03 * _pjp_ has quit ("Leaving.")