Skip to main content

Simple Make file

I kind of hate make files...

But let's start it from scratch ....
I'll use gcc for the compilation on windows using cygwin ...

File name: main.c

#include <stdio.h> int main(int argc,char *argv[]) { printf("You see, u see this... I'm running"); return 0; }

$ gcc main.c -o mobi.exe

$ ./mobi.exe
You see, u see this... I'm running

Great ... Let's make a make file for this. Sounds funny .

So, What essentially does a make file do ?
It compiles. cool... but helps to keep configuration and order once and for all.

file: mobi.mk

all:
    gcc main.c -o mobi.exe


NOTE: Use  notepad for make file... Try not using Notepad++ or u may waste sometime to figure out why.

Let use make file:

$ make -f ./mobi.mk
gcc main.c -o mobi.exe


 So for so good...

Comments

Popular posts from this blog

Culture Information and Localization in .NET

Namespace: System.Globalization CultureInfo Class:                 It provides information like the Format of numbers and dates, Culture’s Calendar, Culture’s language and sublanguage (if applicable), Country and region of the culture. The Basic use of CultureInfo class is shown here: • How string Comparisons are performed • How Number Comparison & Formats are performed • Date Comparison and Formats. • How resources are retrieved and used. Cultures are grouped into three categories: Invariant Culture : It’s Culture Insensitive. It can be used to build some trial application. It can be also used to build an application with hard-coded expiry date that ignores cultures. But using it for every comparison will be incorrect and inappropriate. Neutral Culture : English(en), Frensh(fr), and Spanish(sp). A neutral culture is related to language but it’s not related to specific regi...

Data Serialization in .Net

Namespace: System.Runtime.Serialization Serialization is the process of converting object so that they can be transmitted over the network, or stored in file for later use, or passing them to a web service or any other application. .Net WebServices, Session Object, .Net Remoting and clipboard rely on Serialization. Binary Serialization: It’s efficient but not portable solution. String data = “Hello”; FileStream fs = new FileStream(“FileStream.Data”, FileMode.Create); BinaryFormatter bf = new BinarFormatter (); Bf.Serilize(fs, data); //Wrting Objects Bf.Serilize(fs,System.DateTime.Now); Fs.close(); Deserializing Objects FileStream fs = new FileStream(“FileStream.Data”, FileMode.Open); BinaryFormatter bf = new BinarFormatter (); String Data = (String)bf.Deserialize(fs); DateTime vTime = (DateTime) bf.Derialize(fs); To serialize a class one must the Serializeable attribute to that class. To omit some attribute from deseriali...

Using ADO.NET Transaction Object, Saving CLR Objects and SqlNotificationRequest

Serializable allows one transaction to complete before the other start. SqlConnectoin support named savpoint to roll back to; that’s an equaliant to save transaction command in MS SQL Server. Using TransactionScope Object : A transaction can’t span multiple connections.   Local and distributed transaction ares supported in 1.x you have to Enterpeise seveices library to regiser multiple connections and then call EnlistDistributedTransaction. Distributed Transaction Coordinator is required for Distributed transaction that’s available on windows 2000 & +. In 2.X and later use TransactionScope object. Serializable allows one transaction to complete before the other start. SqlConnectoin support named savpoint to roll back to; that’s an equaliant to save transaction command in MS SQL Server. Using TransactionScope Object : Dispoase of the transaction must be called to complete the transaction. Distributed Transaction : ...