-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
106 lines (78 loc) · 2.39 KB
/
Makefile
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#-------------------------------------------------------------------------------
#
# Makefile for a stand alone application based on MEGAlib
#
# Copyright (C) by Andreas Zoglauer.
# All rights reserved.
#
#
# Usage:
# make -f Makefile.StandAlone PRG=<filename without *.cxx>
#
# Options:
# CMD=<command line parameters>
#
# debug: call gdb
# clean: remove program and library
#
# Example:
# make -f Makefile.StandAlone PRG=Extract
#
# The Makefile needs a completely compiled MEGAlib to function properly.
# The program is automatically placed in $(MEGALIB)/bin.
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Program and directories
SHELL=/bin/sh
PRG=ConvertSimRoa.cxx
CMD=
# Basic directories
TOP = $(MEGALIB)
SR = $(TOP)/src
IN = $(TOP)/include
LB = $(TOP)/lib
BN = $(TOP)/bin
HT = $(TOP)/doc/html
CT = $(TOP)/cint
MPRG=$(subst .cxx,,$(PRG))
MLIBS = -L$(LB) -lMimrecGui -lMimrec -lRevanGui -lRevan -lSivanGui -lSivan -lSpectralyzeGui -lSpectralyze -lGeomegaGui -lGeomega -lCommonMisc -lCommonGui
#-------------------------------------------------------------------------------
# Included options (result of ./configure)
include $(TOP)/config/Makefile.options
include $(TOP)/config/Makefile.config
CXXFLAGS += -I$(IN)
#-------------------------------------------------------------------------------
# Commands:
all: $(BN)/$(MPRG)
ifneq ($(CMD),)
@$(MPRG) $(CMD)
endif
only: $(BN)/$(MPRG)
run: $(BN)/$(MPRG)
@$(MPRG) $(CMD)
debug: $(BN)/$(MPRG)
@echo "r $(CMD)" > /tmp/$(MPRG).ini
@gdb $(BN)/$(MPRG) -x /tmp/$(MPRG).ini
@rm -f /tmp/$(MPRG).ini
clean:
rm -f $(LB)/$(MPRG).o
rm -f $(BN)/$(MPRG)
#-------------------------------------------------------------------------------
# Dependencies:
$(BN)/$(MPRG): $(LB)/$(MPRG).o
ifeq "$(strip $(HEASOFTINSTALLED))" "0"
@$(LD) $(LDFLAGS) $< $(MLIBS) -lcfitsio -lm $(GLIBS) $(LIBS) -L$(LHEASOFT)/lib -o $@
else
@$(LD) $(LDFLAGS) $< $(MLIBS) $(GLIBS) $(LIBS) -o $@
endif
@echo "Program $(MPRG) successfully linked... and starting..."
$(LB)/$(MPRG).o: $(MPRG).cxx
ifeq "$(strip $(HEASOFTINSTALLED))" "0"
@$(CXX) $(CXXFLAGS) -I$(LHEASOFT)/include -c $< -o $@
else
@$(CXX) $(CXXFLAGS) -c $< -o $@
endif
@echo "Program $(MPRG) successfully compiled..."
#
#-------------------------------------------------------------------------------