Searching \ for '[PIC]: Format of makefile ?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Format of makefile ?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Format of makefile ?'
2003\07\18@155018 by

picon face
Hi.

(Not a 100% PIC question, but close...)

I'm currently re-writing my build script for
Olins dev.env to use MAKE ( using NMAKE from an MS VC
installation. Anyone know of any stand-alone, good
make utility ?).

Now, I have some problems. For some reason I can't
get more then the first rule/command combo to
run. Anything after the first is just ignorded.
If I comment out the first rule/command (with #),
the next rule combo runs just fine.

This is a part of the file :

---------------------------------------------------------------
source          =  c:\embedinc\source\d01
src             =  c:\embedinc\src\d01
ins_aspic_cmd   =  src_ins_aspic
aspic_cmd       =  src_aspic
libpic_cmd      =  src_libpic
expic_cmd       =  src_expic


$(src)\d01lib.inc : $(source)\d01lib.ins.aspic
       $(ins_aspic_cmd) D01 d01lib


$(src)\d01.inc : $(source)\d01.ins.aspic $(src)\d01lib.inc
       $(ins_aspic_cmd) D01 D01
----------------------------------------------------------------

I this example only the first (D01LIB) file is built, the
second rule is never evaluated. It doesn't matter if first
file D01LIB is up-to-date or not.

If I just change it into :

---------------------------------------------------------------
[Same macro defines...]


#$(src)\d01lib.inc : $(source)\d01lib.ins.aspic
#       $(ins_aspic_cmd) D01 d01lib
#

$(src)\d01.inc : $(source)\d01.ins.aspic $(src)\d01lib.inc
       $(ins_aspic_cmd) D01 D01
----------------------------------------------------------------

Then the seceond file (D01) is built.

The make program is called from a BAT file that in turn is called from UltraEdit.

Have been struggling this afternoon with this, using all make docs I
could find on the net and the debug switch (/D) in NMAKE...

Regards
Jan-Erik.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\07\18@155640 by John Temples

flavicon
face
On Fri, 18 Jul 2003, Jan-Erik Soderholm XA (TN/PAC) wrote:

> Anyone know of any stand-alone, good make utility ?

Get GNU make from Cygwin; don't waste your time with NMAKE.

--
John W. Temples, III

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\07\18@160512 by

picon face
Thanks !
Checked the cygwin site.
There are a number of "packages" there that seems
to include a lot more then just the make tool.

Before I download and install a complete package,
do you know if the make tool is available alone ?

Jan-Erik.

John Temples wrote:

> On Fri, 18 Jul 2003, Jan-Erik Soderholm XA (TN/PAC) wrote:
>
>> Anyone know of any stand-alone, good make utility ?
>
> Get GNU make from Cygwin; don't waste your time with NMAKE.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\07\18@161138 by John Temples

flavicon
face
On Fri, 18 Jul 2003, [iso-8859-1] Jan-Erik Söderholm XA (TN/PAC) wrote:

> Before I download and install a complete package,
> do you know if the make tool is available alone ?

I think it requires DLLs in the base package.  The installer lets you
pick and choose what you want to download and install; you should be
able to just install "make" and whatever is required to support it.

--
John W. Temples, III

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\07\18@163248 by Dipperstein, Michael

face picon face
Take a look at the GNUWin project: http://gnuwin.epfl.ch/
They have a make that doesn't require any DLLs that windows doesn't already ship
with.

-Mike

{Original Message removed}

2003\07\18@165338 by

picon face
Dipperstein, Michael wrote:
> Take a look at the GNUWin project: http://gnuwin.epfl.ch/
> They have a make that doesn't require any DLLs that windows doesn't already ship
> with.


Checked that site. Lots of tool, but it's not clear which of
them are the "make" tool. Any pointer ?

Jan-Erik.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\07\18@165750 by

picon face
Found it ! It's in a "package" called "UnxUtils".

Jan-Erik.

-----Original Message-----
From: Jan-Erik Soderholm XA (TN/PAC)
Sent: den 18 juli 2003 22:52
To: spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU
Subject: Re: [PIC]: Format of makefile ?


Dipperstein, Michael wrote:
> Take a look at the GNUWin project: http://gnuwin.epfl.ch/
> They have a make that doesn't require any DLLs that windows doesn't already ship
> with.


Checked that site. Lots of tool, but it's not clear which of
them are the "make" tool. Any pointer ?

Jan-Erik.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\07\18@170224 by Dipperstein, Michael

face picon face
Make is actually part of UnxUtils:

http://gnuwin.epfl.ch/apps/unxutils/en/index.html

You need to download the whole package, but make works on its own.

-Mike

{Original Message removed}

2003\07\18@171609 by Dave Tweed

face
flavicon
face
Jan-Erik <.....jan-erik.xa.soderholmKILLspamspam@spam@ERICSSON.COM> wrote:
> Dipperstein, Michael wrote:
> > Take a look at the GNUWin project: http://gnuwin.epfl.ch/
> > They have a make that doesn't require any DLLs that windows doesn't
> > already ship with.
>
> Checked that site. Lots of tool, but it's not clear which of
> them are the "make" tool. Any pointer ?

You could also try the DOS port of the GNU tools, available at
  http://www.delorie.com/djgpp/

This is what I use; it works in any Windows command-prompt window, at least
up thru Win2K.

Also, here's the Makefile I use to build Olin's HAL project. Note that I
don't mess around with separate source and build directories; I prefer to
archive sources using CVS.

-- Dave Tweed

==============================================================================
# Embed/src/hal/Makefile

# Embed, Inc. tools

PREPIC = ../../com/prepic

# Microchip tools

ASM = "c:/Program Files/MPLAB/MPASMWIN"
LINK = "c:/Program Files/MPLAB/MPLINK" /k "../pic"

# Other tools

RM = del

HAL_OBJS = hal_strt.o hal_ad.o hal_eyes.o hal_init.o hal_intr.o hal_main.o \
hal_port.o hal_rand.o hal_soun.o hal_s09.o hal_s16.o hal_s22.o hal_s35.o \
owl.o howl.o pop.o pop2.o

# Embed's preprocessor

%.asm: %.aspic
       $(PREPIC) $< $@

%.inc: %.ins.aspic
       $(PREPIC) $< $@

# Assemble

%.o: %.asm
       $(ASM) /c- /q /o $@ $<

# Link

hal.hex: $(HAL_OBJS)
       echo "FILES $(HAL_OBJS)" >temp.lkr
       $(LINK) p16f876m.lkr temp.lkr /m hal.map /o $@

# Cleanup

clean:
       $(RM) *.ERR
       $(RM) *.LST
       $(RM) temp.lkr

realclean: clean
       $(RM) *.asm
       $(RM) *.inc
       $(RM) *.O
       $(RM) *.map
       $(RM) *.cod
       $(RM) *.hex

# Additional source dependencies

hal_ad.o: hal.inc hallib.inc

hal_eyes.o: hal.inc hallib.inc

hal_init.o: hal.inc hallib.inc

hal_intr.o: hal.inc hallib.inc

hal_main.o: hal.inc hallib.inc

hal_port.o: hal.inc hallib.inc

hal_rand.o: hal.inc hallib.inc

hal_s09.o: hallib.inc

hal_s16.o: hallib.inc

hal_s22.o: hallib.inc

hal_s35.o: hallib.inc

hal_soun.o: hal.inc hallib.inc

hal_strt.o: hal.inc hallib.inc

howl.o: hal.inc hallib.inc

owl.o: hal.inc hallib.inc

pop.o: hal.inc hallib.inc

pop2.o: hal.inc hallib.inc
==============================================================================

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\07\19@105756 by

picon face
So, just got MAKE to work with the Embedinc tools
(thanks to Dave Tweeds example)

Seems as you can *not* call a BAT file from within
a "makefile". After the first call to a BAT file,
MAKE just exits. After changing the makefile to
call the EXE's (PREPIC, MPASMWIN and MPLINK) directly,
all now works. Does this sounds reasonable ?

(I'm using the UnxUtils package from GNUWIN, b.t.w.)

I'll include generic examples of a makefile and build
(BAT) file to call MAKE in my next version of the
PDF document. It will also include a section
on initial setup of a new project and tips on
setting up a working environment within UltraEdit with
examples of calls to the build (BAT) file and Xwisp/Wisp628.
Maybe later today...

Right now I have two buttons in a "PIC-toolbar" in UE,
one "re-makes" the project (after automaticly saving all
modified source files) using make to re-build "as-needed",
the other button re-flashes the PIC using Xwisp. Nice... :-)

Jan-Erik.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

2003\07\19@111712 by Peter L. Peres

picon face
> Anyone know of any stand-alone, good make utility ?

GNU make is free. Also search simtel archives. I think that NMAKE is not
such a good idea. M$ has a way of doing things their own way (and not
documenting more than 50% of it). Just my opinion. I use GNU make (the
DJGPP version) to build under DOS for mcs51 and pic. Also GNU make under
Linux for same. It will work in windows. Another make utility is from
Borland. If you have any one of their compiler packages then you have it.

Anyway in your example, there is only one goal (by default, the first
one). So to make them both add a goal like:

all: first_product 2nd_product ...

at the start of the makefile

Peter

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body

2003\07\19@120247 by

picon face
Peter L. Peres wrote:

> GNU make is free. Also search simtel archives. I think that NMAKE is not
> such a good idea....

Hm, has this mail been on it's way for a day or so ?
Or maybe you just didn't check the later posts
on the subject. :-)

Anyway, I'v got a working make using the make from gnuwin.
And someday I might even understand what I'm doing :-)
Obviously there are a way to have it working without
adding a "all:" goal !?


My current makefile looks like this :

-------------------------------------------------------------
prepic          =  c:\embedinc\com\prepic
asm             =  c:\Program\MPLAB IDE\MCHIP_Tools\MPASMWIN.EXE
link            =  c:\Program\MPLAB IDE\MCHIP_Tools\MPLINK.EXE
D01_objs        =  d01_strt.o d01_init.o d01_cmd.o d01_intr.o \
                  d01_main.o d01_port.o d01_s16.o d01_uart.o

%.asm   : %.aspic
       $(prepic) $< $@

%.inc   : %.ins.aspic
       $(prepic) $< $@

%.o     : %.asm
       $(asm) /c- /q /o$@  $<

d01.hex : $(D01_objs)
       echo "FILES $(D01_objs)" > temp.lkr
       $(link) D01.lkr temp.lkr /m d01.map /o $@


d01_strt.o  : d01.inc d01lib.inc
[one similar line per "o" file...]

-------------------------------------------------------------


The call to make looks like this :



-------------------------------------------------------------
@echo off
rem
rem   BUILD_D01
rem
rem   Build the D01 firmware from the D01 library.
rem   Using
rem

cd c:\embedinc\src\D01
copy ..\..\source\D01\*.aspic *.*
copy ..\..\source\D01\*.lkr *.*
copy ..\..\source\D01\makefile2 *.*

make -i -r -f makefile

-------------------------------------------------------------
(Yes, I know the "makefile" filename is the default...)

I can delete all files in the src directory and all
with be rebuild from scratch.



Jan-Erik.





{Original Message removed}

2003\07\19@132417 by Andre Abelian

picon face
Peter,

What does make file do? What other things can
You do with it?

Andre


-----Original Message-----

Peter L. Peres wrote:

> GNU make is free. Also search simtel archives. I think that NMAKE is
not
> such a good idea....

Hm, has this mail been on it's way for a day or so ?
Or maybe you just didn't check the later posts
on the subject. :-)

Anyway, I'v got a working make using the make from gnuwin.
And someday I might even understand what I'm doing :-)
Obviously there are a way to have it working without
adding a "all:" goal !?


My current makefile looks like this :

-------------------------------------------------------------
prepic          =  c:\embedinc\com\prepic
asm             =  c:\Program\MPLAB IDE\MCHIP_Tools\MPASMWIN.EXE
link            =  c:\Program\MPLAB IDE\MCHIP_Tools\MPLINK.EXE
D01_objs        =  d01_strt.o d01_init.o d01_cmd.o d01_intr.o \
                  d01_main.o d01_port.o d01_s16.o d01_uart.o

%.asm   : %.aspic
       $(prepic) $< $@

%.inc   : %.ins.aspic
       $(prepic) $< $@

%.o     : %.asm
       $(asm) /c- /q /o$@  $<

d01.hex : $(D01_objs)
       echo "FILES $(D01_objs)" > temp.lkr
       $(link) D01.lkr temp.lkr /m d01.map /o $@


d01_strt.o  : d01.inc d01lib.inc
[one similar line per "o" file...]

-------------------------------------------------------------


The call to make looks like this :



-------------------------------------------------------------
@echo off
rem
rem   BUILD_D01
rem
rem   Build the D01 firmware from the D01 library.
rem   Using
rem

cd c:\embedinc\src\D01
copy ..\..\source\D01\*.aspic *.*
copy ..\..\source\D01\*.lkr *.*
copy ..\..\source\D01\makefile2 *.*

make -i -r -f makefile

-------------------------------------------------------------
(Yes, I know the "makefile" filename is the default...)

I can delete all files in the src directory and all
with be rebuild from scratch.



Jan-Erik.





-----Original Message-----
From: Peter L. Peres [EraseMEplpspam_OUTspamTakeThisOuTACTCOM.CO.IL]
Sent: den 19 juli 2003 17:16
To: PICLISTspamspam_OUTMITVMA.MIT.EDU
Subject: [PIC]: Format of makefile ?


> Anyone know of any stand-alone, good make utility ?

GNU make is free. Also search simtel archives. I think that NMAKE is not
such a good idea. M$ has a way of doing things their own way (and not
documenting more than 50% of it). Just my opinion. I use GNU make (the
DJGPP version) to build under DOS for mcs51 and pic. Also GNU make under
Linux for same. It will work in windows. Another make utility is from
Borland. If you have any one of their compiler packages then you have
it.

Anyway in your example, there is only one goal (by default, the first
one). So to make them both add a goal like:

all: first_product 2nd_product ...

at the start of the makefile

Peter

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2003\07\19@134124 by
picon face
(I'm not Peter, but I think I know anyway...)

Using the makefile (and a "make" tool), you say that,

"to build objectfile xyz.o, asm file xyz.asm is to assambled
using *this* command".

So, make checks the date of the o file, if that is *later*
then the date of the asm file, nothing happens. The asm
file has *not* been changed after the o file was created.

But if the data of the o file is *earlier* then the asm
file, the o file is rebuilt (using the command in the
makefile).

So, whenever you re-build your project, you only
rebuilds those modules that has been chanaged since
the last re-build.

Or, in short, MAKE saves time. If you have a large
project with many small source files, the saved time
can be rellatively large if only one source file
is changed between each build.

Jan-Erik.


Andre Abelian wrote:
> Peter,
>
> What does make file do? What other things can
> You do with it?

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body

2003\07\20@181725 by Peter L. Peres

picon face
> What does make file do? What other things can
> You do with it?

makefile is a set of instructions for a program called make that can run
commands for you (and save a lot of typing and time). I think someone once
wrote an adventure game in make but that  is beyond the point. make works
by rules. Eg rules:

this: a b c
<tab>   some_program -input a b c -output this

that: this
<tab>   some_other_program -input this -output that

<tab> means one or more tab characters. This is important. You cannot use
spaces here for most make programs.

Each step in your job is described by a rule, and make will know how to
find them. Eg for the above 'make that' will go to the that rule, discover
that it depends on this, go to the this rule, find a, b, c, and produce
this from them, then go back to the that rule and make that from this. But
if this already exists when that looks for it, then it will be used
instead of being made, provided it is more recent than all of a,b and c.

make does not care what the programs actually do, it just knows how to
navigate the rules and run the programs. It also has a lot of clever
defaults built in, and wildcards, and default build rules and much much
more. It seems to be the standard tool for building software packages
under most operating systems excepting M$ Windows (which had to have their
own kind of make which is incompatible with everyone else's, by using
different default rules).

Peter

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu>

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...