Mail Archives: djgpp/2000/04/04/12:33:05
From: | buers AT gmx DOT de (Dieter Buerssner)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: make files
|
Date: | 4 Apr 2000 12:13:13 GMT
|
Lines: | 40
|
Message-ID: | <8ccm8m$65ljd$2@fu-berlin.de>
|
References: | <8cao98$sr9$1 AT zingo DOT tninet DOT se>
|
NNTP-Posting-Host: | pec-1-203.tnt1.s2.uunet.de (149.225.1.203)
|
Mime-Version: | 1.0
|
X-Trace: | fu-berlin.de 954850393 6477421 149.225.1.203 (16 [17104])
|
X-Posting-Agent: | Hamster/1.3.13.0
|
User-Agent: | Xnews/03.02.04
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Patrik Willbo wrote:
>I have this problem with make files
>I'm trying to create a make file with game.cpp and gamefunc.cpp
>both of them has to have gamefunc.h game.h and items.h included
>how do I write a make file so it will compile it with allegro?????
You can try the following *untested* makefile, that does not
use any special gmake features, and should work with any make
utility. It may give you an idea, how make works.
CC=gcc
LD=gpp
LDFLAGS=-g
CFLAGS=-O -Wall -g
LIBS=-lallegro
OBJS=game.o gamefunc.o
# Rules for making object files
# The indented lines must start with a Tab character
.c.o:
$(CC) -c $(CFLAGS) $<
.cpp.o:
$(CC) -c $(CFLAGS) $<
# This is the default (first) target
game.exe : $(OBJS)
$(LD) $(LDFLAGS) -o game.exe $(OBJS) $(LIBS)
# Dependencies, gcc -MM *.cpp can help to create those
game.o: game.cpp game.h gamefunc.h items.h
gamefunc.o: gamefunc.cpp game.h gamefunc.h items.h
-- Dieter
- Raw text -