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

« back to all changes in this revision

Viewing changes to src/full/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 full language.
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             = $(FULL_OUT_DIR)
14
 
OUT_P   = $(FULL_OUT_DIR)/prof
15
 
 
16
 
## Source files ###########################################################
17
 
 
18
 
src_files               = $(patsubst ./%,%,$(shell $(FIND) . -name '*.hs' -o -name '*.lhs'))
19
 
all_hs_files    = $(src_files) $(OUT)/Agda/Syntax/Parser/Parser.hs \
20
 
                                                           $(OUT)/Agda/Syntax/Parser/Lexer.hs
21
 
all_hs_files_p  = $(src_files) $(OUT_P)/Agda/Syntax/Parser/Parser.hs \
22
 
                                                           $(OUT_P)/Agda/Syntax/Parser/Lexer.hs
23
 
 
24
 
h_files                 = undefined.h
25
 
out_h_files             = $(patsubst %,$(OUT)/%,$(h_files))
26
 
out_p_h_files   = $(patsubst %,$(OUT_P)/%,$(h_files))
27
 
 
28
 
## Phony targets ##########################################################
29
 
 
30
 
.PHONY : default clean prof
31
 
 
32
 
## Default target #########################################################
33
 
 
34
 
default : $(OUT)/agda
35
 
 
36
 
## Creating the output directory structure ################################
37
 
 
38
 
dirs            = $(shell $(FIND) . -type d -not -name CVS)
39
 
out_dirs        = $(filter-out .,$(patsubst ./%,$(OUT)/%,$(dirs)))
40
 
out_dirs_p      = $(filter-out .,$(patsubst ./%,$(OUT_P)/%,$(dirs)))
41
 
 
42
 
$(out_dirs) $(out_dirs_p) :
43
 
        $(MKDIR) -p $@
44
 
 
45
 
## Boot files #############################################################
46
 
 
47
 
# hs-boot files have to be in the same place as the corresponding hs file.
48
 
# Thus we have to copy the boot files for the generated files (Lexer and
49
 
# Parser) to the out directiory.
50
 
 
51
 
boot_files = $(OUT)/Agda/Syntax/Parser/Lexer.hs-boot
52
 
boot_files_p = $(OUT_P)/Agda/Syntax/Parser/Lexer.hs-boot
53
 
 
54
 
$(OUT)/% : %
55
 
        @cp $< $@
56
 
 
57
 
$(OUT_P)/% : %
58
 
        @cp $< $@
59
 
 
60
 
## Header files ###########################################################
61
 
 
62
 
$(out_h_files) : $(OUT)/%.h : %.h
63
 
        @cp $< $@
64
 
 
65
 
$(out_p_h_files) : $(OUT_P)/%.h : %.h
66
 
        @cp $< $@
67
 
 
68
 
## Compatibility ##########################################################
69
 
 
70
 
# If we don't have ghc-6.6 we need to supply some of the libraries.
71
 
 
72
 
ifeq ($(HAVE_GHC_6_6),No)
73
 
 
74
 
GHC_FLAGS += -i$(COMPAT_SRC_DIR)
75
 
 
76
 
endif
77
 
 
78
 
## Compiling agda #########################################################
79
 
 
80
 
prof : $(OUT_P)/agda
81
 
 
82
 
GHC_FLAGS += -package QuickCheck-1.0
83
 
 
84
 
$(OUT)/agda : $(out_dirs) $(out_h_files) $(all_hs_files) $(boot_files)
85
 
        $(GHC) --make -o $@ -i$(OUT) -I. -odir $(OUT) -hidir $(OUT) $(GHC_FLAGS) Main.hs
86
 
 
87
 
$(OUT_P)/agda : $(out_dirs_p) $(out_p_h_files) $(all_hs_files_p) $(boot_files_p)
88
 
        $(GHC) --make -o $@ -i$(OUT_P) -I. -odir $(OUT_P) -hidir $(OUT_P) $(GHC_FLAGS) Main.hs -prof -auto-all
89
 
 
90
 
## Rules for happy and alex ###############################################
91
 
 
92
 
$(OUT)/%.hs : %.x
93
 
        $(ALEX) $(ALEX_FLAGS) -o $@ $<
94
 
 
95
 
$(OUT)/%.hs : %.y
96
 
        $(HAPPY) $(HAPPY_FLAGS) -o $@ --info=$(OUT)/$*.happy.out $<
97
 
 
98
 
$(OUT_P)/%.hs : %.x
99
 
        $(ALEX) $(ALEX_FLAGS) -o $@ $<
100
 
 
101
 
$(OUT_P)/%.hs : %.y
102
 
        $(HAPPY) $(HAPPY_FLAGS) -o $@ --info=$(OUT_P)/$*.happy.out $<
103
 
 
104
 
## Tags ###################################################################
105
 
 
106
 
hTags=../hTags/dist/build/hTags/hTags
107
 
hTags_include=../../dist/build/autogen/cabal_macros.h
108
 
 
109
 
$(hTags) :
110
 
        $(MAKE) -C ../hTags
111
 
 
112
 
# create tags for VIM
113
 
tags : $(src_files) $(hTags) $(hTags_include)
114
 
        $(hTags) -i$(hTags_include) -c $(src_files)
115
 
 
116
 
# create tags for emacs
117
 
TAGS : $(src_files) $(hTags) $(hTags_include)
118
 
        $(hTags) -i$(hTags_include) -e $(src_files)
119
 
 
120
 
# Andreas: create tags for everything exept Auto and Compilers
121
 
ignore = $(patsubst ./%,%,$(shell $(FIND) ./Agda/Auto ./Agda/Compiler -name '*.hs' -o -name '*.lhs'))
122
 
tag_files = $(filter-out $(ignore),$(src_files))
123
 
 
124
 
mytags :  $(tag_files) $(hTags) $(hTags_include)
125
 
        $(hTags) -i$(hTags_include) -e $(tag_files)