summaryrefslogtreecommitdiff
path: root/Examples/d/variables/Makefile
blob: a8808c9c5cdf51e0254d3f26a8060d32b2f4e41f (plain)
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
ifeq (2,$(D_VERSION))
  WORKING_DIR = d2/
else
  WORKING_DIR = d1/
endif

TOP           = ../../..
SWIG          = $(TOP)/../preinst-swig
EXTRA_CFLAGS  = -I../ ../example.c example_wrap.c
EXTRA_LDFLAGS = example.o example_wrap.o
TARGET        = example_wrap
SWIGOPT       =
DSRCS         = *.d
DFLAGS        = -ofrunme

check: build
	cd $(WORKING_DIR); \
	$(MAKE) -f $(TOP)/Makefile d_run

build:
	cd $(WORKING_DIR); \
	$(MAKE) -f $(TOP)/Makefile EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT) -outcurrentdir ../example.i' TARGET='$(TARGET)' d; \
	$(MAKE) -f $(TOP)/Makefile DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile

clean:
	cd $(WORKING_DIR); \
	$(MAKE) -f $(TOP)/Makefile d_clean