List Info

Thread: Makefile generation.. an experiment




Makefile generation.. an experiment
user name
2006-10-17 03:32:43
Manuel,
   I was expanding on an suggestion from Dan concerning
simplification 
of the generated Makefile.
   This code is very raw but it does work for LUSER with
tests enabled 
in LFS. I am still working on a method to include the
optimization 
switches.
   This method has possibilities of reducing both the
generated makefile 
and removing many of the common_functions procedures.




define LUSER_build
  $(call echo_message, Building)
  ./progress_bar.sh $ $$PPID &
  echo -e "n`date`nnKB: `du -skx
--exclude=$(SCRIPT_ROOT) 
$(MOUNT_PT)`n" >logs/$
  $(call remove_existing_dirs,$(1))
  $(call unpack,$(1))
  $(call get_pkg_root_LUSER)
  if
[ $(TEST) = "3" ]; then 
    echo "export  TEST_LOG=$(TESTLOGDIR)/$"
>> envars; && 
    echo -e 'n`date`n' >$(TESTLOGDIR)/$;
   fi;
   (
time { source ~/.bashrc &&
$(CMDSDIR)/chapter05/$ >> logs/$ 
2>&1; } ) 2>> logs/$ && $(PRT_DU)
>> logs/$
   $(call remove_build_dirs,$(2))
   $(call housekeeping)
endef


028-binutils-pass1:  022-settingenvironment
	$(call LUSER_build,binutils-2.17.tar.bz2,binutils)

029-gcc-pass1:  028-binutils-pass1
	$(call LUSER_build,gcc-4.1.1.tar.bz2,gcc)

030-linux-headers:  029-gcc-pass1
	$(call LUSER_build,linux-2.6.18.tar.bz2,linux-headers)

031-glibc:  030-linux-headers
	$(call LUSER_build,glibc-2.5.tar.bz2,glibc)

032-adjusting:  031-glibc
	$(call echo_message, Building)
	./progress_bar.sh $ $$PPID &
	echo -e "n`date`nnKB: `du -skx
--exclude=$(SCRIPT_ROOT) 
$(MOUNT_PT)`n" >logs/$
	(
time { source ~/.bashrc &&
$(CMDSDIR)/chapter05/$ >> logs/$ 2>&1; 
} ) 2>> logs/$ && 
	$(PRT_DU) >> logs/$
	$(call housekeeping)

036-gcc-pass2:  032-adjusting
	$(call LUSER_build,gcc-4.1.1.tar.bz2,gcc)

037-binutils-pass2:  036-gcc-pass2
	$(call LUSER_build,binutils-2.17.tar.bz2,binutils)

038-ncurses:  037-binutils-pass2
	$(call LUSER_build,ncurses-5.5.tar.gz,ncurses)

039-bash:  038-ncurses
	$(call LUSER_build,bash-3.1.tar.gz,bash)

....


-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Makefile generation.. an experiment
user name
2006-10-17 17:31:26
El Martes, 17 de Octubre de 2006 05:32, George Boudreau
escribió:
> Manuel,
>    I was expanding on an suggestion from Dan concerning
simplification
> of the generated Makefile.
>    This code is very raw but it does work for LUSER
with tests enabled
> in LFS. I am still working on a method to include the
optimization
> switches.
>    This method has possibilities of reducing both the
generated makefile
> and removing many of the common_functions procedures.

My concern with that method is, if I'm not wrong, that it
will move the body 
of each target to a Makefile function, making more hard to
insert conditional 
steps, like the ones required for optimizations or PACO.

Or maybe you are thinking on creating dynamically
makefile-functions file 
based on configuration options.

-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:       http://www.linuxfroms
cratch.org
LFS en castellano: http://www.escomp
oslinux.org/lfs-es http://www.lfs-es.info
TLDP-ES:                           http://es.tldp.org
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Makefile generation.. an experiment
user name
2006-10-17 19:05:35
M.Canales.es wrote:
> El Martes, 17 de Octubre de 2006 05:32, George Boudreau
escribió:
>> Manuel,
>>    I was expanding on an suggestion from Dan
concerning simplification
>> of the generated Makefile.
>>    This code is very raw but it does work for LUSER
with tests enabled
>> in LFS. I am still working on a method to include
the optimization
>> switches.
>>    This method has possibilities of reducing both
the generated makefile
>> and removing many of the common_functions
procedures.
> 
> My concern with that method is, if I'm not wrong, that
it will move the body 
> of each target to a Makefile function, making more hard
to insert conditional 
> steps, like the ones required for optimizations or
PACO.
> 
> Or maybe you are thinking on creating dynamically
makefile-functions file 
> based on configuration options.
> 
   There is so little left to be done with JHALFS I am doing
this as a 
design exercise. I am looking at all possibilities and
dynamic entry 
creation is one of them. Nothing is carved in stone.
   This may be a heretical statement, I am also looking at a

non-makefile methodology. (We use so little of the makefile
capabilities).

-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Makefile generation.. an experiment
user name
2006-10-17 21:20:00
On 10/17/06, George Boudreau <georgeblinuxfromscratch.org> wrote:

>    There is so little left to be done with JHALFS I am
doing this as a
> design exercise. I am looking at all possibilities and
dynamic entry
> creation is one of them. Nothing is carved in stone.
>    This may be a heretical statement, I am also looking
at a
> non-makefile methodology. (We use so little of the
makefile capabilities).

You may already know this, but a good place to look for
examples of
real world, powerful use of make is in the kernel. The
scripts
directory does a lot of special make work. Kbuild.include
has some
interesting functions.

http://kernel.or
g/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=sc
ripts/Kbuild.include

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )