[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Gmake: just execute commant
From: |
kristof . loots |
Subject: |
Gmake: just execute commant |
Date: |
22 Mar 2006 07:20:47 -0800 |
User-agent: |
G2/0.2 |
Hi,
Makefiles are totally new for me and I do understand there strengths
but I just want to have a command that is always executed at the
starting of the makefile.
I know, it is not what make is build for, but anyway. It is sometimes
useful to be able to execute some commands without having to add them
to all targets.
An examples shows what I mean.
Makefile
======
#here a command that I want to execute. How can I do this?
echo "Just some useful stuff"
# top-level rule to create the program.
all: main
# compiling the source file.
main.o: main.c
gcc -g -Wall -c main.c
# linking the program.
main: main.o
gcc -g main.o -o main
# cleaning everything that can be automatically recreated with "make".
clean:
/bin/rm -f main main.o
- Gmake: just execute commant,
kristof . loots <=