annotate Makefile @ 122:9fb96c170bbc

Make build process less noisy and also work with parallel make.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 09 Mar 2016 13:56:20 +0200
parents 8dda5f225083
children 6bbec928dfbb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 # Configuration settings for Linux and generic UNIX
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 # See other Makefile.* files for more options.
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 #
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 # C-compiler, flags and linker flags
68
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
7 PREFIX ?= /usr/local
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
8 CC ?= gcc
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
9 AR ?= ar
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
10 RANLIB ?= ranlib
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
11 INSTALL ?= install
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
13 CFLAGS += -DHAVE_CONFIG_H
68
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
14 LDFLAGS +=
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
16 CFLAGS += -DHAVE_STRING_H
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
17 CFLAGS += -DHAVE_STDINT_H
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 #CFLAGS += -DHAVE_SYS_TYPES_H
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
19 CFLAGS += -DHAVE_INTTYPES_H
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 # Miscellaneous
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 BINPATH=./
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 OBJPATH=obj/unix/
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 EXEEXT=
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
4
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
27 ###
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
28 ### Stuff
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
29 ###
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
30 ENDIANCHK_BIN=$(BINPATH)endianchk$(EXEEXT)
68
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
31 NOINST_TARGETS += $(ENDIANCHK_BIN) config.h
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
32 THLIBS_DEP += config.h
4
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
33
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 include Makefile.gen
4
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
35
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
36
6
be3ccb7ca790 Improve build.
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
37 $(ENDIANCHK_BIN): endianchk.c
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
38 @echo " CC $@"
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
39 @$(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
4
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
40
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
41 config.h: $(ENDIANCHK_BIN)
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
42 $(ENDIANCHK_BIN) > $@
68
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
43
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
44 install: all
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 54
diff changeset
45 @for fn in $(TARGETS); do echo " INSTALL $$fn $(PREFIX)/bin/"; $(INSTALL) -m 755 "$$fn" $(PREFIX)/bin/; done