~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to src/core/Makefile

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-08-05 06:38:12 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140805063812-io8e77niomivhd49
Tags: 2.4.0.2-1
* [6e140ac] Imported Upstream version 2.4.0.2
* [2049fc8] Update Build-Depends to match control
* [93dc4d4] Install the new primitives
* [e48f40f] Fix typo dev→doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Makefile for the core language implementation
2
 
# Author: Ulf Norell
3
 
 
4
 
## Includes ###############################################################
5
 
 
6
 
TOP = ../..
7
 
 
8
 
include $(TOP)/mk/config.mk
9
 
include $(TOP)/mk/paths.mk
10
 
 
11
 
## Directories ############################################################
12
 
 
13
 
OUT     = $(CORE_OUT_DIR)
14
 
OUT_P   = $(CORE_OUT_DIR)/prof
15
 
 
16
 
## Phony targets ##########################################################
17
 
 
18
 
.PHONY : default clean
19
 
 
20
 
## Default target #########################################################
21
 
 
22
 
default : $(OUT)/agdacore
23
 
 
24
 
## Files ##################################################################
25
 
 
26
 
gen_hs_files = $(OUT)/Core/Par.hs $(OUT)/Core/Lex.hs $(OUT)/Core/Abs.hs \
27
 
                                $(OUT)/Core/Print.hs
28
 
all_hs_files = $(shell $(FIND) . -name '*hs') $(gen_hs_files)
29
 
 
30
 
## Creating the output directory structure ################################
31
 
 
32
 
dirs            = $(shell $(FIND) . -type d -not -name CVS)
33
 
out_dirs        = $(patsubst .%,$(OUT)%,$(dirs))
34
 
out_dirs_p      = $(filter-out .,$(patsubst .%,$(OUT_P)%,$(dirs)))
35
 
 
36
 
$(out_dirs) $(out_dirs_p) :
37
 
        $(MKDIR) -p $@
38
 
 
39
 
## Boot files pre 6.4 #####################################################
40
 
 
41
 
# Before ghc 6.4 you wrote hi-boot files. In 6.4 you write hs-boot files
42
 
# which ghc compiles into hi-boot files (with a very different format from
43
 
# the ones you wrote by hand). So if we are compiling with a pre-6.4 ghc
44
 
# we have to copy the hand-written hi-boot files to the out directory.
45
 
 
46
 
ifeq ($(HAVE_GHC_6_4),No)
47
 
 
48
 
src_hi_boot_files       = $(shell $(FIND) . -name '*.hi-boot')
49
 
hi_boot_files           = $(patsubst ./%,$(OUT)/%,$(src_hi_boot_files))
50
 
hi_boot_files_p         = $(patsubst ./%,$(OUT_P)/%,$(src_hi_boot_files))
51
 
 
52
 
$(OUT)/%.hi-boot : $(hi_boot_files) : %.hi-boot
53
 
        cp $< $@
54
 
 
55
 
$(OUT_P)/%.hi-boot : $(hi_boot_files_p) : %.hi-boot
56
 
        cp $< $@
57
 
 
58
 
endif
59
 
 
60
 
## Compiling agda #########################################################
61
 
 
62
 
GHC_FLAGS += -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns
63
 
 
64
 
$(OUT)/agdacore : $(out_dirs) $(all_hs_files) $(hi_boot_files)
65
 
        $(GHC) --make -o $@ -odir $(OUT) -hidir $(OUT) -i$(OUT) $(GHC_FLAGS) Main.hs
66
 
 
67
 
$(OUT_P)/agdacore : $(out_dirs_p) $(all_hs_files) $(hi_boot_files_p)
68
 
        $(GHC) --make -o $@ -odir $(OUT_P) -hidir $(OUT_P) -i$(OUT) $(GHC_FLAGS) Main.hs -prof -auto-all
69
 
 
70
 
## BNFC rules #############################################################
71
 
 
72
 
$(OUT)/%/Par.y $(OUT)/%/Lex.x $(OUT)/%/Abs.hs : %.cf
73
 
        bnfc -haskell -d $<
74
 
        -rm -rf $(OUT)/$*
75
 
        mv $* $(OUT)
76
 
 
77
 
## Rules for happy and alex ###############################################
78
 
 
79
 
%.hs : %.x
80
 
        $(ALEX) $(ALEX_FLAGS) $< -o $@
81
 
 
82
 
%.hs : %.y
83
 
        $(HAPPY) $(HAPPY_FLAGS) --info=$*.happy.out $< -o $@
84
 
 
85
 
## Clean ##################################################################
86
 
 
87
 
clean :
88
 
        rm -f $(generated_files)
89
 
 
90
 
veryclean : clean
91
 
 
92
 
debug :
93
 
        @echo $(out_dirs)
94