Alternatives to make for linux/freebsd?
I like SCons. It is constructed in such a way that every build script (a SConstruct
file) is also a syntactically valid Python program. So, you can build arbitrary Python logic into your build script if you need to.
It's also much faster than make
and calculates many kinds of dependencies automatically.
Can i make operating system using FreeBSD kernel? And build same alternative as Chromium-OS only HTML5
Yes this is possible.
One of the most prominent Linux distributions to date, Debian, also does this. See here: http://www.debian.org/ports/kfreebsd-i386/
So, if it runs Debian, it will also run your web OS.
makefile under freebsd does not compile (works on linux)
Yesterday I found the problem:
all:
@(echo -; echo Making HTTP++ library..; make $(OBJDIR)/lib$(DISTLIB).a)
This line is bad when the makefile is used with gmake
, because it calls make instead of gmake. So the fix is:
all:
@(echo -; echo Making HTTP++ library..; gmake $(OBJDIR)/lib$(DISTLIB).a)
Now it works perfectly without any adjustments when using gmake
.
Solaris/FreeBSD vs. Linux for Java development
I would suggest separating concerns.
Choose a stable distribution as the host operating system and then install a virtual machine environment in it (like vmware player). Then install those unstable ones you need to track inside it, plus perhaps even a Windows instance.
You can then run those you need to, when you need to, while keeping your stable distribution unharmed.
Make starts in wrong directory under FreeBSD
Answering my own question here.
From the FreeBSD make
man page:
.OBJDIR A path to the directory where the targets are built. Its
value is determined by trying to chdir(2) to the follow-
ing directories in order and using the first match:
1. ${MAKEOBJDIRPREFIX}${.CURDIR}
(Only if `MAKEOBJDIRPREFIX' is set in the environ-
ment or on the command line.)
2. ${MAKEOBJDIR}
(Only if `MAKEOBJDIR' is set in the environment or
on the command line.)
3. ${.CURDIR}/obj.${MACHINE}
4. ${.CURDIR}/obj
5. /usr/obj/${.CURDIR}
6. ${.CURDIR}
Variable expansion is performed on the value before it's
used, so expressions such as
${.CURDIR:S,^/usr/src,/var/obj,}
may be used. This is especially useful with
`MAKEOBJDIR'.
`.OBJDIR' may be modified in the makefile via the special
target `.OBJDIR'. In all cases, make will chdir(2) to
the specified directory if it exists, and set `.OBJDIR'
and `PWD' to that directory before executing any targets.
The key part being
In all cases, make will chdir(2) to specified directory if it exists, and set
.OBJDIR'
PWD' to that directory before executing any targets.
By contrast, the GNU make manual page makes no such reference to any sort of automatic determination of OBJDIR
, only that it will be used if it is set.
The solution was to override the OBJDIR
variable via the pseudotarget .OBJDIR
:
.OBJDIR: ./
all:
cd src && make
clean:
cd src && make clean
An alternative solution is to prefix the cd
targets with ${CURDIR}
, which isn't modified after the chdir
into OBJDIR
.
I don't get why gmake
behaved the same way, however. That feels almost like a bug to me.
What is equivalent of Linux's 'free' command on FreeBSD v8.1
vmstat
has default output which is similar in nature and takes many options that give extremely detailed information, egvmstat -m
swapinfo
would cover the swap parttop -d1
causes top to print one screen and exit, and the banner is very similar tofree
. Usetop -d1 | head -n 7
to see only the banner
C++ build systems
I've used SCons for over a year now and it's really cool. It's a full build system, not a build scripts generator.
It's Python based, and you write the SConstruct and SConscript (equivalent of Makefile) in Python which allows you to call any available library you may wish for and a much clearer syntax that what a Makefile authorize.
Since Python is crossplatform, so is SCons, no problem there.
It comes bundled with a good number of targets:
- detects the binary available and automatically maps a number of extensions toward the correct binaries
- detects the correct extensions for your objects/libraries depending on the OS, though you can override it
- provides facilities for common operations (to be delayed after the build) like Move, Copy, Tar, and you can provide your own python scripts and hook them
- works out of the box and yet provides many hooks of customization at every level
It's really efficient, and even proposes advanced features (like storing a hash of the preprocessed file in a sqlite db instead of using the timestamp) even though you decide of your strategy in the end.
It also offers dependencies cycle detection for free (something that definitely does not come with Makefiles) and the interface is generally just better / automated.
Did I say it was efficient ? Well it obviously allows for multiple jobs to be executed in parallel ;)
And it's also free, like in free drink, feel free to contribute ;)
I can only recommend it.
Related Topics
How to Check Out a Particular Version in Git from 'Git Log'
Killing Process in Shell Script
How to Specify Which Version of Perl to Use on Centos
Is Wget or Similar Programs Always Available on Posix Systems
Difference Between a Stripped Binary and a Non Stripped Binary in Linux
What Ncurses Frameworks Are Available for Bash
Berkeley Db Mismatch Error While Configuring Ldap
Busybox in Embedded Linux Shows "Applet Not Found"
Gcloud - How to Automate Installation of Gcloud on a Server
Embedding an Application (In This Case a Terminal) Within a Qt Application
Time Waste of Execv() and Fork()
How to Exit The Wh Mode in Gdb
Scsi Read (10) and Write (10) with The Scsi Generic Interface
Getting Following Error After The Command Sudo Apt-Get Update on Ubuntu 16.04