summaryrefslogtreecommitdiff
path: root/ext/mcpat/makefile
blob: f5af29e740fed5bfa62c113ce7a63c51a13e10ad (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
28
29
30
TAR = mcpat
BUILD_DIR ?= ../../build
ODIR = $(BUILD_DIR)/mcpat

.PHONY: all dbg opt clean clean_dbg clean_opt

all: opt

dbg: $(TAR).mk $(ODIR)/obj_dbg
	@$(MAKE) TAG=dbg ODIR=$(ODIR) -C . -f $(TAR).mk

opt: $(TAR).mk $(ODIR)/obj_opt
	@$(MAKE) TAG=opt ODIR=$(ODIR) -C . -f $(TAR).mk

$(ODIR)/obj_dbg:
	mkdir -p $@

$(ODIR)/obj_opt:
	mkdir -p $@

clean: clean_dbg clean_opt

clean_dbg: $(ODIR)/obj_dbg
	@$(MAKE) TAG=dbg ODIR=$(ODIR) -C . -f $(TAR).mk clean
	rm -rf $<

clean_opt: $(ODIR)/obj_opt
	@$(MAKE) TAG=opt ODIR=$(ODIR) -C . -f $(TAR).mk clean
	rm -rf $<