On Thu, Nov 15, 2012 at 1:13 PM, Marc Espie <es...@nerim.net> wrote: > On Thu, Nov 15, 2012 at 05:53:52PM +0100, Reyk Floeter wrote: >> For all the GNU people, here is how a Makefile for hello.c should look like: >> PROG= hello >> NOMAN= yes >> .include <bsd.prog.mk> >> >> Yes, you're supposed to provide a man page hello.1 and remove the NOMAN line >> :) > > Well, a portable Makefile for hello.c would be: > > .POSIX: > > OBJS = hello.o > > hello: $(OBJS) > $(CC) -o $@ $(CFLAGS) $(OBJS) > > > > anything else (all, install, whatever) are just bonus. > Surprisingly, .PHONY is not even standard... >
a portable Makefile would be: .POSIX: hello: because posix mandates built-in implicit rules for `.c:' (why is pointing out these examples useful?)