Mercurial > hg > nnchat
comparison 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 |
comparison
equal
deleted
inserted
replaced
664:87ef546de419 | 665:23d16d9cdf96 |
---|---|
1 ## | |
2 ## Common UNIX style Makefile stuff | |
3 ## | |
4 PREFIX ?= /usr/local | |
5 CC ?= cc | |
6 AR ?= ar | |
7 RANLIB ?= ranlib | |
8 INSTALL ?= install | |
9 DOC ?= README | |
10 | |
11 CFLAGS += -DHAVE_CONFIG_H | |
12 | |
13 | |
14 ## | |
15 ## Miscellaneous | |
16 ## | |
17 BINPATH ?= ./ | |
18 OBJPATH ?= obj/unix/ | |
19 EXEEXT ?= | |
20 | |
21 ENDIANCHK_BIN = $(BINPATH)endianchk$(EXEEXT) | |
22 NOINST_TARGETS += $(ENDIANCHK_BIN) config.h | |
23 | |
24 | |
25 include Makefile.gen | |
26 | |
27 | |
28 ## | |
29 ## Generate endian check and config.h | |
30 ## | |
31 $(ENDIANCHK_BIN): endianchk.c | |
32 $(CC) $(CFLAGS) -o $@ $+ | |
33 | |
34 config.h: $(ENDIANCHK_BIN) | |
35 $(ENDIANCHK_BIN) > $@ | |
36 | |
37 | |
38 ## | |
39 ## Install targets | |
40 ## | |
41 install: all | |
42 @for fn in $(TARGETS); do echo " INSTALL $$fn $(PREFIX)/bin/"; $(INSTALL) -m 755 "$$fn" $(PREFIX)/bin/; done |