Data wrangler, software engineer, systems programmer, cyclist. Unix (mostly Solaris) for aeons. I talk C, Python, SQL, Performance, Java, Kafka and Makefiles.
Location
Brisbane, Australia
Education
BA (Mathematics, Modern History), University of Queensland
I rewrote the core Solaris build system (6000+ Makefiles, lead a team of 4 for 3 years to deliver it), so my make knowledge is skewed towards the make which comes with Solaris Studio, but there are lots of similarities with the GNU version.
For C code, you'd use CC and CFLAGS, you'd also specify LDFLAGS for the linker, etc etc.
When it comes to your bin/boot target, I'd have written that differently too - to make the subdir dependency explicit:
bin:
@mkdir -p bin
bin/boot: bin
@(curlcmd....)
@chmod 0555 $@
I did a lot of gnarly things with Solaris' make pattern matching rules
(for which I sometimes think I still need therapy). Case in point: Solaris has a closed subrepo for delivering binary blobs to partner companies. In order to remove a lot of extra work, I rewrote a few specific install rules to put those blobs in the right place in one hit:
The last comment I'll make is that the % character only matches the same pattern in the target and dependency - it's a rather simplistic regex
$(BUILDDIR)/%.o: $(SRCDIR)/%.c
We had to work around this all the time, and that limitation alone added several months to the project while we figured out the most efficient way of doing so.
Ah, thanks so much for the tips! That's one issue with such a flexible tool - a bunch of ways to do something can mean it's hard to find the way to do it best. I can see at a glance why both your suggestions are superior but also see why I got where I did and stopped thinking. I'll keep this in mind in the future.
That's a terrifying recipe. I love it.
I did not know that about % - thanks for pointing out the distinction!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice intro article, thankyou.
I rewrote the core Solaris build system (6000+ Makefiles, lead a team of 4 for 3 years to deliver it), so my make knowledge is skewed towards the make which comes with Solaris Studio, but there are lots of similarities with the GNU version.
First comment: you define your c++ compiler as
I'd have written this differently:
For C code, you'd use CC and CFLAGS, you'd also specify LDFLAGS for the linker, etc etc.
When it comes to your
bin/boot
target, I'd have written that differently too - to make the subdir dependency explicit:I did a lot of gnarly things with Solaris' make pattern matching rules
(for which I sometimes think I still need therapy). Case in point: Solaris has a closed subrepo for delivering binary blobs to partner companies. In order to remove a lot of extra work, I rewrote a few specific install rules to put those blobs in the right place in one hit:
Line noise making things faster, ftw.
The last comment I'll make is that the
%
character only matches the same pattern in the target and dependency - it's a rather simplistic regexWe had to work around this all the time, and that limitation alone added several months to the project while we figured out the most efficient way of doing so.
Ah, thanks so much for the tips! That's one issue with such a flexible tool - a bunch of ways to do something can mean it's hard to find the way to do it best. I can see at a glance why both your suggestions are superior but also see why I got where I did and stopped thinking. I'll keep this in mind in the future.
That's a terrifying recipe. I love it.
I did not know that about
%
- thanks for pointing out the distinction!