[Home]

Summary:ASTERISK-04253: zaptel makefile cleanup
Reporter:Kevin P. Fleming (kpfleming)Labels:
Date Opened:2005-05-21 13:46:06Date Closed:2011-06-07 14:05:06
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) zaptel_Makefile3_109.diff.txt
( 1) zaptel_Makefile3.diff.txt
Description:The makefiles seem to require many fixes to be used by the Debian packages. I wanted to submit most of those fixes, and in the process clean up the makefiles. Zaptel seemed like a good place to start as it has some obvious places. This attempts to address some.<br />
<br />
Problems:<br />
<br />
* Not trivial to build for a different kernel than the one installed. `uname -r` is used in a number of place.<br />
<br />
* long and complicated $(shell) constructs. When lines start to get over 80 chars, things are messy.<br />
<br />
* make will silently fail. Unlike a standard makefile, dependencies are not used well enough here and an error that prevented from building half the targets could go unnoticed.<br />
<br />
* long and complicated install target<br />
<br />
<br />
I attach a diff with numerous changes. I don't expect them to be implemented as-is, but I hope it can be a point of reference. It did get zaptel built on my system, but I use Stable, so I haven't really tested further.<br />
<br />
Some of the changes:<br />
<br />
* using the static rule '$(MODULES): %.c: %.o zaptel.h' helped cleaning up the modules part. Smilar rules could be used<br />
<br />
* Use ':=' instead of '=' in many places<br />
<br />
* Is there a reason not to use -fsigned-char everywhere? It seems to be a nop on platforms where it's not required for zaptel. It is reuired on some other platforms, BTW: mips, s390, etc. (big endians?)<br />
<br />
* define KSRC as a user-overridable kernel source path. Uses 'uname -r' if not set.<br />
<br />
* /usr/include/linux is used not only by the breakage-happy people of RedHat. Is it used on practically any distro.<br />
<br />
* don't add a $(shell if .. then echo ..) to CFLAGS and co. use them in ifneq conditions.<br />
<br />
* Where there are nested make if-s, indent (with spaces!)<br />
<br />
* ldconfig: Not happy about hwat I put.
Comments:By: Kevin P. Fleming (kpfleming) 2005-05-21 13:46:43

Russell: if you want some help figuring out how to apply some/all of this to Zaptel STABLE, let me know.

By: Olle Johansson (oej) 2005-07-30 07:19:46

Gentle reminder from housekeeping, old bug report that needs some attention... :-)

/O

By: Tzafrir Cohen (tzafrir) 2005-08-11 11:37:59

Just uploaded some more "advanced" versions of that patch.

zaptel_Makefile3_109.diff.txt is simply the version I use in my zaptel 1.0.9.1 package.

zaptel_Makefile3.diff.txt is against HEAD from two days ago. It adapts the same changes.

I posted both patches here even though they are "big" and "hard to swalow" because I use them both to build my packages. Anyway, I believe both are of use for the general public, except maybe their change of handilng of ztdummy.

Both are disclaimed.

By: Russell Bryant (russell) 2005-11-04 11:17:22.000-0600

I have modified the 1.0 Makefile to allow building for a kernel other than the currently running one.  However, I'm not going to make any other changes.  It doesn't really matter since it is about to be deprecated, anyway.

By: Russell Bryant (russell) 2005-11-04 11:17:23.000-0600

I have modified the 1.0 Makefile to allow building for a kernel other than the currently running one.  However, I'm not going to make any other changes.  It doesn't really matter since it is about to be deprecated, anyway.