Mail Archives: djgpp/1996/07/16/21:00:46
Bresie (breezy AT dali DOT math DOT swt DOT edu) wrote:
: I hope that I have just not overlooked it in the FAQs or the regular Info, but
: I have just started using djgpp and have made a few programs, which I decided
: would eventually need a makefile to make things easier.
: When I did the, I found that my CFLAGS were not being included (or so I
: assume) when compiled (they are not displayed; I do not know if they are
: not displayed to begin with but anyway...)
: Ultimately, the output of the compilation looks something along the lines of:
: gcc -c init.c
: without anything else being displayed.
: Am I missing something?
: My makefile looks like this:
: # constants
: ALL = main.o init.o inputq.o
: LIB_FLAGS = -L/C/djgpp/LIB -lxlib
: CFLAGS = $(LIB_FLAGS -O2)
Probably CFLAGS = $(LIB_FLAGS) -O2
but you don't need LIB_FLAGS in gcc -c anyway.
: RM = del
: CC = gcc $(CFLAGS)
: # main program
: main.exe: $(ALL)
: $(CC) $(ALL) -o main.exe
: main.o: main.c main.h consts.h init.h defines.h xlib.h inputq.h
: $(CC) -c main.c
: init.o: init.c consts.h
: $(CC) -c init.c
: inputq.o: inputq.c inputq.h
: $(CC) -c inputq.c
: clean:
: $(RM) *.o
Well, the implicit .o.c rule uses a command line something like
$(CC) $(CFLAGS) -o xxx.o -c xxx.c. If you want to use CFLAGS in you
own rules, you have to specify it explicitly.
bye, Alexander
--
Alexander Lehmann, | "On the Internet,
alex AT hal DOT rhein-main DOT de (plain, MIME, NeXT) | nobody knows
lehmann AT mathematik DOT th-darmstadt DOT de (plain) | you're a dog."
!!CHANGED!! <URL:http://www.mathematik.th-darmstadt.de/~lehmann/>
- Raw text -