1#
2#  Makefile --
3#
4#     Makefile for building plug-ins for primitives.
5#
6#  Copyright (c) 2001-2013 Bjorn Gustavsson
7#
8#  See the file "license.terms" for information on usage and redistribution
9#  of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10#
11#     $Id: Makefile,v 1.14 2006/08/02 22:44:40 antoneos Exp $
12#
13include ../../erl.mk
14
15.SUFFIXES: .erl .jam .beam .yrl .xrl .bin .mib .hrl .sgml .html .ps .3 .1 \
16	.fig .dvi .tex .class .java .pdf .psframe .pscrop
17
18ESRC=.
19WINGS_INTL=../../intl_tools
20EBIN=../../plugins/primitives
21WINGS_TOP=../..
22WINGS_E3D=../../e3d
23
24ifeq ($(TYPE),debug)
25TYPE_FLAGS=-DDEBUG
26else
27TYPE_FLAGS=
28endif
29
30MODULES= \
31	wpc_bbox \
32	wpc_cylinder \
33	wpc_geodome \
34	wpc_image \
35	wpc_knot \
36	wpc_ncube \
37	wpc_plane \
38	wpc_spiral \
39	wpc_torus \
40	wpc_tt \
41	wpc_thread
42
43TARGET_FILES= $(MODULES:%=$(EBIN)/%.beam)
44
45# ----------------------------------------------------
46# FLAGS
47# ----------------------------------------------------
48ERL_COMPILE_FLAGS += -Werror -I $(WINGS_TOP) $(TYPE_FLAGS) -pa $(WINGS_INTL) +debug_info
49
50# ----------------------------------------------------
51# Targets
52# ----------------------------------------------------
53
54opt debug:
55	$(MAKE) TYPE=$@ common
56
57template: opt
58	$(ERL) -pa $(WINGS_INTL) -noinput -run tools generate_template_files $(EBIN)
59
60lang: template
61	cp *.lang $(EBIN)
62	$(ERL) -pa $(WINGS_INTL) -noinput -run tools diff_lang_files $(EBIN)
63
64common: $(TARGET_FILES)
65
66clean:
67	rm -f $(TARGET_FILES)
68	rm -f core
69
70$(EBIN)/%.beam: $(ESRC)/%.erl
71	$(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
72
73$(EBIN)/wpc_image.beam $(EBIN)/wpc_tt.beam: $(WINGS_E3D)/e3d.hrl
74