www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/21/06:14:59

From: gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: makefile help
Date: 20 Feb 1997 23:26:07 GMT
Organization: Oxford University
Lines: 25
Message-ID: <5eimif$gos@news.ox.ac.uk>
References: <856478065 DOT 19598 DOT 0 AT slicksoft DOT demon DOT co DOT uk>
NNTP-Posting-Host: mc31.merton.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

steve wilcox (stewilcox AT slicksoft DOT demon DOT co DOT uk) wrote:
: can someone tell me how to make a makefile so i can just compile and
: link 1 cc file and link with allegro library ?

If you're only linking one file, you can just use:

gxx -o foo.exe -Wall -O2 -c foo.cc -lalleg

In a makefile, you could write:

all : foo.exe

foo.exe : foo.o
	gxx -o foo.exe foo.o -lalleg

foo.o : foo.cc foo1.h foo2.h (etc)
	gcc -Wall -O2 -c foo.cc

where foo1.h, foo2.h, ... are any included files which might change as your
project develops. You don't need to put standard include files like stdio.h in
here - they won't be altered.

-- 
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019