All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] migrating manual makefile to autotools-based packages
@ 2016-04-06 13:14 aurelien coulaud
  2016-04-06 17:18 ` aurelien coulaud
  0 siblings, 1 reply; 5+ messages in thread
From: aurelien coulaud @ 2016-04-06 13:14 UTC (permalink / raw)
  To: buildroot

Hello,

I am using an old buildroot 2011 with external packages using manual makefiles.

Now I am migrating to buildroot 2016.02 and this doc
(http://free-electrons.com/~thomas/buildroot/manual/html/ch11.html) explains
that manual makefile are now obsolete.


and the official doc of buildroot does not mention manual makefile :
https://buildroot.org/downloads/manual/manual.html
 
manual makefile is not supported on 2016.02, I am right ?
Is there a way to continue to use manual makefile?

Otherwise is there a tool to migrate easily manual makefile to autotools-based ?

Thank you for your answer.
Best regards,

AC

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] migrating manual makefile to autotools-based packages
  2016-04-06 13:14 [Buildroot] migrating manual makefile to autotools-based packages aurelien coulaud
@ 2016-04-06 17:18 ` aurelien coulaud
  2016-04-08  2:31   ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: aurelien coulaud @ 2016-04-06 17:18 UTC (permalink / raw)
  To: buildroot

aurelien coulaud <aurelien.coulaud@...> writes:

> 
> Hello,
> 
> I am using an old buildroot 2011 with external packages using manual
makefiles.
> 
> Now I am migrating to buildroot 2016.02 and this doc
> (http://free-electrons.com/~thomas/buildroot/manual/html/ch11.html) explains
> that manual makefile are now obsolete.
> 
> and the official doc of buildroot does not mention manual makefile :
> https://buildroot.org/downloads/manual/manual.html
> 
> manual makefile is not supported on 2016.02, I am right ?
> Is there a way to continue to use manual makefile?
> 
> Otherwise is there a tool to migrate easily manual makefile to
autotools-based ?
> 
> Thank you for your answer.
> Best regards,
> 
> AC
> 

hello I found the solution into this slides (page 272):
http://free-electrons.com/doc/training/buildroot/buildroot-slides.pdf

"Note: as of Buildroot 2015.05,
TARGETS
has been renamed to
PACKAGES"

So now my old Package with manual makefile compiles.

Bye,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] migrating manual makefile to autotools-based packages
  2016-04-06 17:18 ` aurelien coulaud
@ 2016-04-08  2:31   ` Thomas Petazzoni
  2016-04-08  8:49     ` aurelien coulaud
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2016-04-08  2:31 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 6 Apr 2016 17:18:05 +0000 (UTC), aurelien coulaud wrote:

> hello I found the solution into this slides (page 272):
> http://free-electrons.com/doc/training/buildroot/buildroot-slides.pdf
> 
> "Note: as of Buildroot 2015.05,
> TARGETS
> has been renamed to
> PACKAGES"
> 
> So now my old Package with manual makefile compiles.

Using hand-written Makefiles is bad, as you lose many features of the
package infrastructure: legal-info, source, source-check, etc. Please
don't use hand-written Makefiles, use one of the available package
infrastructures. Doing the conversion is generally very easy. If you
don't know how to do it, please post your current .mk file and we'll
give you some hints.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] migrating manual makefile to autotools-based packages
  2016-04-08  2:31   ` Thomas Petazzoni
@ 2016-04-08  8:49     ` aurelien coulaud
  2016-04-28  8:24       ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: aurelien coulaud @ 2016-04-08  8:49 UTC (permalink / raw)
  To: buildroot

> 
> Using hand-written Makefiles is bad, as you lose many features of the
> package infrastructure: legal-info, source, source-check, etc. Please
> don't use hand-written Makefiles, use one of the available package
> infrastructures. Doing the conversion is generally very easy. If you
> don't know how to do it, please post your current .mk file and we'll
> give you some hints.
> 
> Best regards,
> 
> Thomas

Hello Thomas, thank in advance.

Here is my file: codebase.mk

#############################################################
#
# codebase
#
#############################################################

CODEBASE_SOURCE=codebase__20061027.tgz
CODEBASE_DIR:=$(BUILD_DIR)/codebase


$(CODEBASE_DIR)/.source: $(DL_DIR)/$(CODEBASE_SOURCE)
	$(ZCAT) $(DL_DIR)/$(CODEBASE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(CODEBASE_DIR) package/codebase/ patch*
	touch $(CODEBASE_DIR)/.source

$(CODEBASE_DIR)/.configured: $(CODEBASE_DIR)/.source
	(cd $(CODEBASE_DIR); \
	export PATH="/usr/local/bin:$(PATH)" ; \
	./bootstrap ; \
        $(TARGET_CONFIGURE_OPTS) \
	CPPFLAGS=-DS4NO_FCVT \
        CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
        LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
	./configure \
	--target=$(GNU_TARGET_NAME) \
	--host=$(GNU_TARGET_NAME) \
	--build=$(GNU_HOST_NAME) \
	--prefix=/usr );
	touch $(CODEBASE_DIR)/.configured
	
$(CODEBASE_DIR)/.compiled: $(CODEBASE_DIR)/.configured
	        $(MAKE) -C $(CODEBASE_DIR)
	        touch $(CODEBASE_DIR)/.compiled

$(STAGING_DIR)/usr/lib/libcb.so: $(CODEBASE_DIR)/.compiled
	$(MAKE) -C $(CODEBASE_DIR) install prefix=$(STAGING_DIR)/usr
exec_prefix=$(STAGING_DIR)/usr
	touch -c $(STAGING_DIR)/usr/lib/libcb.so

$(TARGET_DIR)/usr/lib/libcb.so: $(STAGING_DIR)/usr/lib/libcb.so
	cp -dpf $(STAGING_DIR)/usr/lib/libcb* $(STAGING_DIR)/usr/lib/libcbx*
$(TARGET_DIR)/usr/lib/
	-$(STRIP) --strip-unneeded \
		$(TARGET_DIR)/usr/lib/libcb.so \
		$(TARGET_DIR)/usr/lib/libcbx.so \
	

codebase: $(TARGET_DIR)/usr/lib/libcb.so


#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_CODEBASE)),y)
TARGETS+=codebase
endif

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] migrating manual makefile to autotools-based packages
  2016-04-08  8:49     ` aurelien coulaud
@ 2016-04-28  8:24       ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2016-04-28  8:24 UTC (permalink / raw)
  To: buildroot

>>>>> "aurelien" == aurelien coulaud <aurelien.coulaud@thalesgroup.com> writes:

 > Hello Thomas, thank in advance.

 > Here is my file: codebase.mk

This looks like a pretty normal autotools based package. Look at
E.G. package/libdaemon/libdaemon.mk for an example.

 > #############################################################
 > #
 > # codebase
 > #
 > #############################################################

 > CODEBASE_SOURCE=codebase__20061027.tgz
 > CODEBASE_DIR:=$(BUILD_DIR)/codebase


 > $(CODEBASE_DIR)/.source: $(DL_DIR)/$(CODEBASE_SOURCE)
 > 	$(ZCAT) $(DL_DIR)/$(CODEBASE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
 > 	toolchain/patch-kernel.sh $(CODEBASE_DIR) package/codebase/ patch*
 > 	touch $(CODEBASE_DIR)/.source

This is all handled by the infrastructure if you define something like:

CODEBASE_VERSION = 20061027
CODEBASE_SOURCE = codebase__$(CODEBASE_VERSION).tgz


 > $(CODEBASE_DIR)/.configured: $(CODEBASE_DIR)/.source
 > 	(cd $(CODEBASE_DIR); \
 > 	export PATH="/usr/local/bin:$(PATH)" ; \
 > 	./bootstrap ; \

I take it that bootstrap runs autoreconf - If so, you can tell buildroot
to do so with:

CODEBASE_AUTORECONF = YES

>         $(TARGET_CONFIGURE_OPTS) \
 > 	CPPFLAGS=-DS4NO_FCVT \
 >         CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
 >         LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \

STAGING_DIR should already be in CFLAGS/LDFLAGS.

> 	./configure \
 > 	--target=$(GNU_TARGET_NAME) \
 > 	--host=$(GNU_TARGET_NAME) \
 > 	--build=$(GNU_HOST_NAME) \
 > 	--prefix=/usr );
 > 	touch $(CODEBASE_DIR)/.configured
	
 > $(CODEBASE_DIR)/.compiled: $(CODEBASE_DIR)/.configured
 > 	        $(MAKE) -C $(CODEBASE_DIR)
 > 	        touch $(CODEBASE_DIR)/.compiled

 > $(STAGING_DIR)/usr/lib/libcb.so: $(CODEBASE_DIR)/.compiled
 > 	$(MAKE) -C $(CODEBASE_DIR) install prefix=$(STAGING_DIR)/usr
 > exec_prefix=$(STAGING_DIR)/usr
 > 	touch -c $(STAGING_DIR)/usr/lib/libcb.so

This looks odd. Are you sure you don't just want to do:

make -C $(CODEBASE_DIR) DESTDIR=$(STAGING_DIR) install

If so, that's what buildroot does by default.


 > $(TARGET_DIR)/usr/lib/libcb.so: $(STAGING_DIR)/usr/lib/libcb.so
 > 	cp -dpf $(STAGING_DIR)/usr/lib/libcb* $(STAGING_DIR)/usr/lib/libcbx*
 > $(TARGET_DIR)/usr/lib/
 > 	-$(STRIP) --strip-unneeded \
 > 		$(TARGET_DIR)/usr/lib/libcb.so \
 > 		$(TARGET_DIR)/usr/lib/libcbx.so \
	

And here it does the same except it passes DESTDIR=$(TARGET_DIR)

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-04-28  8:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-06 13:14 [Buildroot] migrating manual makefile to autotools-based packages aurelien coulaud
2016-04-06 17:18 ` aurelien coulaud
2016-04-08  2:31   ` Thomas Petazzoni
2016-04-08  8:49     ` aurelien coulaud
2016-04-28  8:24       ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.