1 | # | |
---|
2 | # o---------------------------------------------------------------------o |
---|
3 | # | |
---|
4 | # | MAD makefile - ifort linker settings |
---|
5 | # | |
---|
6 | # o---------------------------------------------------------------------o |
---|
7 | # | |
---|
8 | # | Methodical Accelerator Design |
---|
9 | # | |
---|
10 | # | Copyright (c) 2011+ CERN, mad@cern.ch |
---|
11 | # | |
---|
12 | # | For more information, see http://cern.ch/mad |
---|
13 | # | |
---|
14 | # o---------------------------------------------------------------------o |
---|
15 | # | |
---|
16 | # | $Id$ |
---|
17 | # | |
---|
18 | |
---|
19 | ################ |
---|
20 | # Unix Settings |
---|
21 | # |
---|
22 | ifneq ($(OSTYPE),Windows) |
---|
23 | |
---|
24 | # |
---|
25 | # linker flags |
---|
26 | # |
---|
27 | |
---|
28 | LDFLAGS = -m$(ARCH) -O$(NOPT) -nofor-main -static-intel -static-libgcc |
---|
29 | LDLIBS = |
---|
30 | |
---|
31 | ifneq ($(CXXNAME),) |
---|
32 | LDFLAG += -cxxlib |
---|
33 | LDLIBS += -lstdc++$(if $(call eq,$(OSTYPE),Darwin),-static,) |
---|
34 | endif |
---|
35 | |
---|
36 | ifeq ($(OSTYPE),Darwin) |
---|
37 | LDFLAGS += -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 |
---|
38 | ifeq ($(ARCH),32) |
---|
39 | LDLIBS += -L$(GNULIBDIR) -lgcc_eh |
---|
40 | endif |
---|
41 | endif |
---|
42 | |
---|
43 | # |
---|
44 | # options flags |
---|
45 | # |
---|
46 | |
---|
47 | ifeq ($(DEBUG),yes) |
---|
48 | LDFLAGS += -g -gdwarf-2 -check all |
---|
49 | endif |
---|
50 | |
---|
51 | ifeq ($(PROFILE),yes) |
---|
52 | LDFLAGS += -p |
---|
53 | endif |
---|
54 | |
---|
55 | ifeq ($(STATIC),yes) # build static library |
---|
56 | LDFLAGS += -static$(if $(call eq,$(OSTYPE),Darwin),lib,) |
---|
57 | endif |
---|
58 | |
---|
59 | ifeq ($(SHARED),yes) # build shared library |
---|
60 | LDFLAGS += $(if $(call eq,$(OSTYPE),Darwin),-dynamiclib,-shared) -fPIC |
---|
61 | ifeq ($(OSTYPE),Linux) |
---|
62 | LDLIBS += -lifcore_pic -lifcoremt_pic |
---|
63 | endif |
---|
64 | endif |
---|
65 | |
---|
66 | ifeq ($(PLUGIN),yes) # allow to load dynamically shared library (plugin) |
---|
67 | LDFLAGS += -Bdynamic |
---|
68 | LDLIBS += -ldl |
---|
69 | endif |
---|
70 | |
---|
71 | endif # Unix Settings |
---|
72 | |
---|
73 | # | |
---|
74 | # o---------------------------------------------------------------------o |
---|
75 | # | |
---|
76 | |
---|
77 | ################### |
---|
78 | # Windows Settings |
---|
79 | # |
---|
80 | ifeq ($(OSTYPE),Windows) |
---|
81 | |
---|
82 | # |
---|
83 | # linker flags |
---|
84 | # |
---|
85 | |
---|
86 | LDFLAGS = /nologo /O$(NOPT) /extlnk:.o |
---|
87 | LDLIBS = |
---|
88 | |
---|
89 | # |
---|
90 | # options flags |
---|
91 | # |
---|
92 | |
---|
93 | ifeq ($(DEBUG),yes) |
---|
94 | LDFLAGS += /debug:full /check:all |
---|
95 | endif |
---|
96 | |
---|
97 | ifeq ($(PROFILE),yes) |
---|
98 | LDFLAGS += /Qprof-use |
---|
99 | endif |
---|
100 | |
---|
101 | ifeq ($(STATIC),yes) |
---|
102 | LDFLAGS += /static |
---|
103 | endif |
---|
104 | |
---|
105 | ifeq ($(SHARED),yes) |
---|
106 | LDFLAGS += /shared |
---|
107 | endif |
---|
108 | |
---|
109 | # |
---|
110 | # command translator |
---|
111 | # |
---|
112 | |
---|
113 | LD_tr = $(strip $(subst $(SPACE)/O0 , /Od ,$(subst $(SPACE)-o , /Fe,$1))) |
---|
114 | |
---|
115 | endif # Windows Settings |
---|
116 | |
---|
117 | # end of makefile |
---|