Mercurial > hg > nnchat
diff Makefile.unix @ 665:23d16d9cdf96
Work on the build system, split generic UNIX things into Makefile.unix
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 12 Feb 2016 03:05:07 +0200 |
parents | |
children | dd3083a3383d |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.unix Fri Feb 12 03:05:07 2016 +0200 @@ -0,0 +1,42 @@ +## +## Common UNIX style Makefile stuff +## +PREFIX ?= /usr/local +CC ?= cc +AR ?= ar +RANLIB ?= ranlib +INSTALL ?= install +DOC ?= README + +CFLAGS += -DHAVE_CONFIG_H + + +## +## Miscellaneous +## +BINPATH ?= ./ +OBJPATH ?= obj/unix/ +EXEEXT ?= + +ENDIANCHK_BIN = $(BINPATH)endianchk$(EXEEXT) +NOINST_TARGETS += $(ENDIANCHK_BIN) config.h + + +include Makefile.gen + + +## +## Generate endian check and config.h +## +$(ENDIANCHK_BIN): endianchk.c + $(CC) $(CFLAGS) -o $@ $+ + +config.h: $(ENDIANCHK_BIN) + $(ENDIANCHK_BIN) > $@ + + +## +## Install targets +## +install: all + @for fn in $(TARGETS); do echo " INSTALL $$fn $(PREFIX)/bin/"; $(INSTALL) -m 755 "$$fn" $(PREFIX)/bin/; done