aboutsummaryrefslogtreecommitdiffstats
path: root/erts/epmd/src/Makefile.in
blob: b6e3ba77629e175729e84af8391dc50f8b286c3d (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#
# %CopyrightBegin%
# 
# Copyright Ericsson AB 1998-2012. All Rights Reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 
# %CopyrightEnd%
#
include $(ERL_TOP)/make/target.mk

ifeq ($(findstring ose,$(TARGET)),ose)
include $(ERL_TOP)/make/$(TARGET)/ose_lm.mk
endif

ifeq ($(TYPE),debug)
PURIFY     =
TYPEMARKER = .debug
TYPE_FLAGS = -DDEBUG @DEBUG_FLAGS@
else

ifeq ($(TYPE),purify)
PURIFY     = purify
TYPEMARKER =
ifeq ($(findstring ose,$(TARGET)),ose)
  TYPE_FLAGS = -DPURIFY
else
  TYPE_FLAGS = -O2 -DPURIFY
endif
else

override TYPE = opt
PURIFY     =
TYPEMARKER =
ifeq ($(findstring ose,$(TARGET)),ose)
  TYPE_FLAGS =
else
  TYPE_FLAGS = -O2
endif
endif
endif

include $(ERL_TOP)/make/$(TARGET)/otp.mk
include ../../vsn.mk
include ../epmd.mk

BINDIR  = $(ERL_TOP)/bin/$(TARGET)
OBJDIR  = $(ERL_TOP)/erts/obj$(TYPEMARKER)/$(TARGET)
ERTS_INCL = -I$(ERL_TOP)/erts/include \
            -I$(ERL_TOP)/erts/include/$(TARGET) \
            -I$(ERL_TOP)/erts/include/internal \
            -I$(ERL_TOP)/erts/include/internal/$(TARGET)

# On windows we always need reentrant libraries.
ifeq ($(TARGET),win32)
ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal_r$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@
else
ifeq ($(findstring vxworks,$(TARGET)),vxworks)
ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@
else
ifeq ($(findstring ose,$(TARGET)),ose)
ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@
else
ERTS_INTERNAL_LIBS=-L../../lib/internal/$(TARGET) -lerts_internal$(ERTS_LIB_TYPEMARKER) @ERTS_INTERNAL_X_LIBS@ -lm
endif
endif
endif

ERTS_LIB = $(ERL_TOP)/erts/lib_src/obj/$(TARGET)/$(TYPE)/MADE

CC      = @CC@
WFLAGS  = @WFLAGS@
CFLAGS  = @CFLAGS@ @DEFS@ $(TYPE_FLAGS) $(WFLAGS) $(ERTS_INCL)
LD      = @LD@
ifeq ($(findstring ose,$(TARGET)),ose)
LIBS    = $(ERTS_INTERNAL_LIBS) @LIBS@
else
LIBS    = @LIBS@ @SYSTEMD_DAEMON_LIBS@ $(ERTS_INTERNAL_LIBS)
endif
LDFLAGS = @LDFLAGS@



# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------

# The targets
ifeq ($(findstring win32,$(TARGET)),win32)
EPMD = epmd.exe
else
EPMD = epmd
endif

INSTALL_PROGS = $(BINDIR)/$(EPMD)

#---------------------------------
# Options
#---------------------------------
 
EPMD_FLAGS = -DEPMD_PORT_NO=$(EPMD_PORT_NO)

#---------------------------------
# source and object file information
#---------------------------------

EPMD_OBJS = $(OBJDIR)/epmd.o       \
               $(OBJDIR)/epmd_cli.o   \
               $(OBJDIR)/epmd_srv.o 

#---------------------------------
# Build targets
#---------------------------------


all: $(BINDIR)/$(EPMD)

docs:

clean:
	rm -f $(BINDIR)/$(EPMD) 
	rm -f $(ERL_TOP)/erts/obj/$(TARGET)/epmd.o
	rm -f $(ERL_TOP)/erts/obj/$(TARGET)/epmd_cli.o
	rm -f $(ERL_TOP)/erts/obj/$(TARGET)/epmd_srv.o 
	rm -f *.o
	rm -f *~ core

ifeq ($(findstring ose,$(TARGET)),ose)
$(OBJDIR)/ose_confd.o: $(OSE_CONFD)
	$(V_CC) $(CFLAGS) -o $@ -c $<
$(OBJDIR)/crt0_lm.o: $(CRT0_LM)
	$(V_CC) $(CFLAGS) -o $@ -c $<
OSE_LM_OBJS += $(OBJDIR)/ose_confd.o $(OBJDIR)/crt0_lm.o
endif

#
# Objects & executables
#

ifeq ($(findstring ose,$(TARGET)),ose)
$(BINDIR)/$(EPMD): $(EPMD_OBJS) $(ERTS_LIB) $(OSE_LM_OBJS)
	$(call build-ose-load-module, $@, $(EPMD_OBJS) $(OSE_LM_OBJS), $(LIBS), $(EPMD_LMCONF))
else
$(BINDIR)/$(EPMD): $(EPMD_OBJS) $(ERTS_LIB)
	$(ld_verbose)$(PURIFY) $(LD) $(LDFLAGS) -o $@ $(EPMD_OBJS) $(LIBS)
endif

$(OBJDIR)/%.o: %.c epmd.h epmd_int.h
	$(V_CC) $(CFLAGS) $(EPMD_FLAGS) -o $@ -c $<

$(ERTS_LIB):
	$(make_verbose)cd $(ERL_TOP)/erts/lib_src && $(MAKE) $(TYPE)

include $(ERL_TOP)/make/otp_release_targets.mk

release_spec: all
	$(INSTALL_DIR)     "$(RELEASE_PATH)/erts-$(VSN)/bin"
	$(INSTALL_PROGRAM) $(INSTALL_PROGS) "$(RELEASE_PATH)/erts-$(VSN)/bin"


release_docs_spec: