aboutsummaryrefslogtreecommitdiffstats
path: root/erts/example/Makefile
blob: 6e1a88b4da5052d82917da83ff690bb5152f5726 (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
# 
# %CopyrightBegin%
# 
# Copyright Ericsson AB 2006-2009. All Rights Reserved.
# 
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
# 
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
# 
# %CopyrightEnd%
# 
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk

EI_ROOT = $(ERL_TOP)/lib/erl_interface
EI_INCLUDE = -I$(EI_ROOT)/include -I$(ERL_TOP)/erts/emulator/beam
EI_LIB = -L$(EI_ROOT)/obj/$(TARGET) -lei

PQ_LIB = -lpq

OUR_C_FLAGS =  -g -Wall -fpic $(EI_INCLUDE)
CFLAGS += $(OUR_C_FLAGS)
CXXFLAGS += $(OUR_C_FLAGS)

TARGETS = pg_sync.beam pg_async.beam pg_sync.so pg_async.so \
next_perm.so next_perm.beam

all: $(TARGETS)

clean:
	rm -f $(TARGETS) *.o
	rm -f pg_async2.so pg_encode2.beam pg_async2.beam
	rm -f core erl_crash.dump
	rm -f *~

pg_async2.o  pg_encode2.o: pg_encode2.h

pg_sync.o pg_async.o pg_encode.o: pg_encode.h


pg_async2.so: pg_encode2.o

pg_sync.so pg_async.so: pg_encode.o

pg_async2.so: pg_async2.o
	$(CC) $(CFLAGS) pg_encode2.o -shared $< $(EI_LIB) $(PQ_LIB) -o $@

%.so: %.cc
	$(CXX) $(CXXFLAGS) $< -shared -o $@

%.so: %.o
	$(CC) $(CFLAGS) pg_encode.o -shared $< $(EI_LIB) $(PQ_LIB) -o $@

%: %.cc
	$(CXX) $(CXXFLAGS) $< -o $@