1#
2# Copyright (C) 1997, Ericsson Telecommunications
3# Author: Kenneth Lundin
4#
5include $(ERL_TOP)/make/target.mk
6include $(ERL_TOP)/make/$(TARGET)/otp.mk
7
8# ----------------------------------------------------
9# Application version
10# ----------------------------------------------------
11include ../vsn.mk
12VSN=$(ASN1_VSN)
13
14# ----------------------------------------------------
15# Release directory specification
16# ----------------------------------------------------
17RELSYSDIR = $(RELEASE_PATH)/lib/asn1-$(VSN)
18
19
20
21
22#
23# Common Macros
24#
25# PARSER_SRC = \
26#	asn1ct_parser.yrl
27
28# PARSER_MODULE=$(PARSER_SRC:%.yrl=%)
29
30EBIN = ../ebin
31CT_MODULES= \
32	asn1ct \
33	asn1ct_check \
34	asn1_db \
35	asn1ct_pretty_format \
36	asn1ct_gen \
37	asn1ct_gen_per \
38	asn1ct_gen_per_rt2ct \
39	asn1ct_name \
40	asn1ct_constructed_per \
41	asn1ct_constructed_ber \
42	asn1ct_gen_ber \
43	asn1ct_constructed_ber_bin_v2 \
44	asn1ct_gen_ber_bin_v2 \
45	asn1ct_value \
46	asn1ct_tok \
47	asn1ct_parser2
48
49RT_MODULES= \
50	asn1rt \
51	asn1rt_per \
52	asn1rt_per_bin \
53	asn1rt_per_v1 \
54	asn1rt_ber_bin \
55	asn1rt_ber_bin_v2 \
56	asn1rt_per_bin_rt2ct \
57	asn1rt_driver_handler \
58	asn1rt_check
59
60#	asn1rt_ber_v1 \
61#	asn1rt_ber \
62# the rt module to use is defined in asn1_records.hrl
63# and must be updated when an incompatible change is done in the rt modules
64
65
66MODULES= $(CT_MODULES) $(RT_MODULES)
67
68ERL_FILES = $(MODULES:%=%.erl)
69
70TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
71
72GENERATED_PARSER = $(PARSER_MODULE:%=%.erl)
73
74# internal hrl file
75HRL_FILES = asn1_records.hrl
76
77APP_FILE = asn1.app
78APPUP_FILE = asn1.appup
79
80APP_SRC = $(APP_FILE).src
81APP_TARGET = $(EBIN)/$(APP_FILE)
82
83APPUP_SRC = $(APPUP_FILE).src
84APPUP_TARGET = $(EBIN)/$(APPUP_FILE)
85
86EXAMPLES = \
87	../examples/P-Record.asn
88
89# ----------------------------------------------------
90# FLAGS
91# ----------------------------------------------------
92ERL_FLAGS +=
93ERL_COMPILE_FLAGS += \
94	-I$(ERL_TOP)/lib/stdlib \
95	+warn_unused_vars
96YRL_FLAGS =
97# ----------------------------------------------------
98# Targets
99# ----------------------------------------------------
100
101debug opt: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
102
103
104clean:
105	rm -f $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) $(GENERATED_PARSER)
106	rm -f core *~
107
108docs:
109
110
111# ----------------------------------------------------
112# Special Build Targets
113# ----------------------------------------------------
114
115$(EBIN)/asn1ct.$(EMULATOR):asn1ct.erl
116	 $(ERLC) -b$(EMULATOR) -o$(EBIN) $(ERL_COMPILE_FLAGS) -Dvsn=\"$(VSN)\" $<
117
118$(APP_TARGET): $(APP_SRC) ../vsn.mk
119	sed -e 's;%VSN%;$(VSN);' $< > $@
120
121$(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
122	sed -e 's;%VSN%;$(VSN);' $< > $@
123
124
125# ----------------------------------------------------
126# Release Target
127# ----------------------------------------------------
128include $(ERL_TOP)/make/otp_release_targets.mk
129
130release_spec: opt
131	$(INSTALL_DIR) $(RELSYSDIR)/ebin
132	$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) $(RELSYSDIR)/ebin
133	$(INSTALL_DIR) $(RELSYSDIR)/src
134	$(INSTALL_DATA) $(PARSER_SRC) $(ERL_FILES) $(HRL_FILES) $(APP_SRC) $(APPUP_SRC) $(RELSYSDIR)/src
135	$(INSTALL_DIR) $(RELSYSDIR)/examples
136	$(INSTALL_DATA) $(EXAMPLES) $(RELSYSDIR)/examples
137
138# there are no include files to be used by the user
139#$(INSTALL_DIR) $(RELSYSDIR)/include
140#$(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
141
142release_docs_spec:
143