forked from jiazhang0/nanoio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.mk
More file actions
30 lines (25 loc) · 759 Bytes
/
env.mk
File metadata and controls
30 lines (25 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
CROSS_COMPILE ?=
CC := $(CROSS_COMPILE)gcc
LD := $(CROSS_COMPILE)ld
AR := $(CROSS_COMPILE)ar
INSTALL ?= install
EXTRA_CFLAGS ?=
EXTRA_LDFLAGS ?=
DEBUG_BUILD ?=
DESTDIR ?=
prefix ?= /usr/local
libdir ?= $(prefix)/lib
bindir ?= $(prefix)/bin
sbindir ?= $(prefix)/sbin
includedir ?= $(prefix)/include
nanomsg_includedir ?= $(includedir)
nanomsg_libdir ?= $(libdir)
LDFLAGS := --warn-common --no-undefined --fatal-warnings \
$(patsubst $(join -Wl,,)%,%,$(EXTRA_LDFLAGS))
CFLAGS := -D_GNU_SOURCE -std=gnu11 -O2 -Wall -Werror \
$(addprefix -I, $(TOPDIR)/src/include $(nanomsg_includedir)) \
-L$(nanomsg_libdir) -lnanomsg -lpthread -lrt \
$(EXTRA_CFLAGS) $(addprefix $(join -Wl,,),$(LDFLAGS))
ifneq ($(DEBUG_BUILD),)
CFLAGS += -ggdb -DDEBUG
endif