1 | srcdir = @srcdir@
|
---|
2 | #VPATH = @srcdir@
|
---|
3 | INSTALL = @INSTALL@
|
---|
4 | prefix = @prefix@
|
---|
5 | exec_prefix = @exec_prefix@
|
---|
6 | bindir = @bindir@
|
---|
7 | CXX=@CXX@
|
---|
8 | AR=@AR@
|
---|
9 | ARFLAGS=@ARFLAGS@
|
---|
10 | RANLIB=@RANLIB@
|
---|
11 | CXXFLAGS=-O -g
|
---|
12 | CFLAGS=-O -g
|
---|
13 |
|
---|
14 | USE_SOPHYA=@use_sophya@
|
---|
15 | USE_PIOLIB=@use_piolib@
|
---|
16 |
|
---|
17 |
|
---|
18 | MACHEROS := $(shell echo `uname`)
|
---|
19 | MACHDIR := $(MACHEROS)-$(CXX)
|
---|
20 |
|
---|
21 |
|
---|
22 | ifeq ($(USE_SOPHYA),1)
|
---|
23 | include $(DPCBASEREP)/Include/MakefileUser.h
|
---|
24 | CPPFLAGS := -DWITH_SOPHYA $(CPPFLAGS)
|
---|
25 | else
|
---|
26 | ifeq ($(CXX), cxx)
|
---|
27 | CXXFLAGS := -O -g -D__USE_STD_IOSTREAM
|
---|
28 | endif
|
---|
29 | endif
|
---|
30 |
|
---|
31 |
|
---|
32 | CPPFLAGS := $(CPPFLAGS) @cfitsincdir@ @pioincdir@ -I. -I$(srcdir)/.. -I.. -DANSI
|
---|
33 |
|
---|
34 | LDLIBS=@cfitslibdir@ -lcfitsio $(LIBS)
|
---|
35 |
|
---|
36 | ifeq ($(MACHEROS),IRIX64)
|
---|
37 | ifeq ($(CXX), g++)
|
---|
38 | LDLIBS=@cfitslibdir@ -lcfitsio -L /usr/lib32/
|
---|
39 | endif
|
---|
40 | ifeq ($(CXX), CC)
|
---|
41 | # CXXFLAGS = -O -prelink -ptused -64
|
---|
42 | CXXFLAGS = -O -prelink -64
|
---|
43 |
|
---|
44 | CFLAGS = -O -64
|
---|
45 | # CXXFLAGS = -LANG:std -woff 1171,1174,1552 -O -OPT:Olimit=0
|
---|
46 | # CFLAGS = -O -OPT:Olimit=0
|
---|
47 | endif
|
---|
48 | endif
|
---|
49 |
|
---|
50 | ifeq ($(CXX), g++)
|
---|
51 | CC = gcc
|
---|
52 | endif
|
---|
53 |
|
---|
54 | ifeq ($(CXX), cxx)
|
---|
55 | CXXFLAGS := $(CXXFLAGS) -ptr ../cxx_repository
|
---|
56 | endif
|
---|
57 |
|
---|
58 | ifeq ($(USE_PIOLIB),1)
|
---|
59 | PIOFILES := piotoirdr.cc
|
---|
60 | else
|
---|
61 | PIOFILES :=
|
---|
62 | endif
|
---|
63 |
|
---|
64 | SRCFILES = toi.cc toimanager.cc toiprocessor.cc \
|
---|
65 | fitstoirdr.cc fitstoiwtr.cc asciitoiwtr.cc \
|
---|
66 | toisegment.cc toiseqbuff.cc cgt.cc \
|
---|
67 | fitsringwtr.cc $(PIOFILES)
|
---|
68 |
|
---|
69 | FILES=$(patsubst %.c,%.o,$(SRCFILES:.cc=.o))
|
---|
70 |
|
---|
71 | default: libatkern.a
|
---|
72 | echo "kernel built"
|
---|
73 |
|
---|
74 | libatkern.a: $(FILES)
|
---|
75 | $(AR) $(ARFLAGS) libatkern.a $(FILES)
|
---|
76 | ln -sf Kernel/libatkern.a ../libatkern.a
|
---|
77 |
|
---|
78 | clean:
|
---|
79 | rm -f *.o
|
---|
80 | rm -rf rii_files ii_files cxxrep cxx_repository
|
---|
81 |
|
---|
82 | %: %.o $(FILES)
|
---|
83 | $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@ -lm
|
---|
84 |
|
---|
85 | %.o:$(srcdir)/%.cc
|
---|
86 | $(COMPILE.cc) -o $@ $<
|
---|
87 |
|
---|
88 | %.o:$(srcdir)/%.c
|
---|
89 | $(COMPILE.c) -o $@ $<
|
---|
90 |
|
---|
91 |
|
---|
92 |
|
---|
93 | %.d: $(srcdir)/%.cc
|
---|
94 | $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
|
---|
95 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
|
---|
96 | [ -s $@ ] || rm -f $@'
|
---|
97 |
|
---|
98 | %.d: $(srcdir)/%.c
|
---|
99 | $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
|
---|
100 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
|
---|
101 | [ -s $@ ] || rm -f $@'
|
---|
102 |
|
---|
103 | include $(patsubst %.c,%.d,$(SRCFILES:.cc=.d))
|
---|
104 |
|
---|