File: Makefile

package info (click to toggle)
hmake 3.12-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 672 kB
  • ctags: 72
  • sloc: haskell: 3,406; sh: 1,235; makefile: 417; ansic: 19
file content (88 lines) | stat: -rw-r--r-- 3,081 bytes parent folder | download | duplicates (6)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
MACHINE := $(shell script/harch)
export MACHINE

# This included config is only for the BUILDWITH variable.
include targets/$(MACHINE)/config.cache
#BUILDCOMP = $(shell echo ${BUILDWITH} | cut -c1-3)
BUILDCOMPS := ghc nhc hbc gcc
BUILDCOMP1 := $(shell echo $(notdir ${BUILDWITH}) | cut -c1-3)
BUILDCOMP2 := $(if $(filter $(BUILDCOMP1), $(BUILDCOMPS)),$(BUILDCOMP1),$(shell ${BUILDWITH} 2>&1 | head -1 | cut -c1-3))
BUILDCOMP := $(if $(filter $(BUILDCOMP2), $(BUILDCOMPS)),$(BUILDCOMP2),$(error Cannot find compiler type))


HMAKE = src/hmake/Makefile* src/hmake/*.hs src/hmake/README* \
	src/hmake/HISTORY src/hmake/Summary* \
	src/interpreter/Makefile* src/interpreter/*.hs \
	src/cpphs/*.hs

LIBDIR  = lib
TARGDIR = targets
TARGETS = hmake-nhc hmake-hbc hmake-ghc chmake hi-nhc hi-hbc hi-ghc chi


##### compiler build + install scripts

all:   all-${BUILDCOMP}
hmake: hmake-${BUILDCOMP}
hi:    hi-${BUILDCOMP}
help:
	@echo "Common targets include:        all install clean realclean config"
	@echo "Common targets include:        hmake hi"
	@echo "For a specific build-compiler: all-hbc  all-ghc  all-nhc98 all-gcc"

config:
	./configure --config
install: all
	./configure --install

all-hbc: hmake-hbc hi-hbc
all-ghc: hmake-ghc hi-ghc
all-gcc: chmake chi
all-nhc: hmake-nhc hi-nhc


$(TARGETS): % : $(TARGDIR)/$(MACHINE)/%


$(TARGDIR)/$(MACHINE)/hmake-nhc: $(HMAKE)
	cd src/hmake;          $(MAKE) HC=$(BUILDWITH) BUILDCOMP=$(BUILDCOMP) all config
	touch $(TARGDIR)/$(MACHINE)/hmake-nhc
$(TARGDIR)/$(MACHINE)/hmake-hbc: $(HMAKE)
	cd src/hmake;          $(MAKE) HC=$(BUILDWITH) BUILDCOMP=$(BUILDCOMP) all config
	touch $(TARGDIR)/$(MACHINE)/hmake-hbc
$(TARGDIR)/$(MACHINE)/hmake-ghc: $(HMAKE)
	cd src/hmake;          $(MAKE) HC=$(BUILDWITH) BUILDCOMP=$(BUILDCOMP) all config
	touch $(TARGDIR)/$(MACHINE)/hmake-ghc
$(TARGDIR)/$(MACHINE)/chmake: $(HMAKEC)
	@echo "WARNING: hmake might not build correctly from C sources!"
	cd src/hmake;          $(MAKE) HC=nhc98 BUILDCOMP=$(BUILDCOMP) fromC config
	touch $(TARGDIR)/$(MACHINE)/chmake

$(TARGDIR)/$(MACHINE)/hi-nhc: $(HMAKE) hmake-nhc
	cd src/interpreter;    $(MAKE) HC=$(BUILDWITH) BUILDCOMP=$(BUILDCOMP) all
	touch $(TARGDIR)/$(MACHINE)/hi-nhc98
$(TARGDIR)/$(MACHINE)/hi-hbc: $(HMAKE) hmake-hbc
	cd src/interpreter;    $(MAKE) HC=$(BUILDWITH) BUILDCOMP=$(BUILDCOMP) all
	touch $(TARGDIR)/$(MACHINE)/hi-hbc
$(TARGDIR)/$(MACHINE)/hi-ghc: $(HMAKE) hmake-ghc
	cd src/interpreter;    $(MAKE) HC=$(BUILDWITH) BUILDCOMP=$(BUILDCOMP) all
	touch $(TARGDIR)/$(MACHINE)/hi-ghc
$(TARGDIR)/$(MACHINE)/chi: $(HMAKEC) chmake
	@echo "WARNING: hi might not build correctly from C sources!"
	cd src/interpreter;    $(MAKE) HC=nhc98 BUILDCOMP=$(BUILDCOMP) fromC
	touch $(TARGDIR)/$(MACHINE)/chi


##### cleanup

clean:
	cd src/hmake;          $(MAKE) clean
	cd src/interpreter;    $(MAKE) clean

realclean: clean
	cd $(TARGDIR)/$(MACHINE);  rm -f $(TARGETS)
	cd $(TARGDIR);  rm -f hmakeC
	rm -f $(LIBDIR)/$(MACHINE)/*
	rm -f $(TARGDIR)/$(MACHINE)/config.cache
	rm -f $(LIBDIR)/$(MACHINE)/hmakerc
	rm -f script/hmake script/hi script/hmake-config