File: bsdmake

package info (click to toggle)
pluto-find-orb 0.0~git20180227-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,668 kB
  • sloc: cpp: 30,743; makefile: 263
file content (107 lines) | stat: -rw-r--r-- 3,446 bytes parent folder | download
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
105
106
107
# Make file for console Find_Orb,  using regular Curses, on BSD
# Based on 'makefile' for Linux (q.v.)  The only difference,  at present,
# is that bsdmake uses .ifdef/.endif instead of plain ifdef/endif.
#
# Usage: make -f [path/]linmake [CLANG=Y] [XCOMPILE=Y] [MSWIN=Y] [tgt]
#
#	where tgt can be any of:
# [all|find_orb|fo|fo_serve]
#
#	'XCOMPILE' = cross-compile for Windows,  using MinGW,  on a BSD box
#	'MSWIN' = compile for Windows,  using MinGW,  on a Windows machine
#	'CLANG' = use clang instead of GCC;  BSD only
# 'X' = use PDCurses instead of ncurses
# None of these: compile using g++ on BSD,  for BSD
#	Note that I've only tried the last of these,  on PC-BSD (which is based
# on FreeBSD).  I would expect CLANG to work,  and one _can_ use MinGW
# on BSD (so I hear;  I've not tried it).  I think PDCurses works Just
# Fine on BSD,  but again,  haven't tried it yet.

CURSES_LIB=-lncursesw
CC=g++
LIBSADDED=-lm
EXE=
OBJSADDED=
RM=rm -f

.ifdef CLANG
	CC=clang
.endif

.ifdef MSWIN
	LIBSADDED=
	EXE=.exe
	OBJSADDED=clipfunc.o
	CURSES_LIB=pdcurses.a -static-libgcc
.endif

.ifdef X
	ADDED_CFLAGS=-DXCURSES -DPDC_WIDE -I../PDCurses
	CURSES_LIB=-lXCurses -lXaw -lXmu -lXt -lX11 -lSM -lICE -lXext -lXpm
.endif

.ifdef XCOMPILE
	CC=x86_64-w64-mingw32-g++
	ADDED_CFLAGS=-DUTF8 -DPDC_WIDE -I/usr/local/include
 OBJSADDED=clipfunc.o
	EXE=.exe
	LIBSADDED=
	CURSES_LIB=pdcurses.a -static-libgcc
.endif

all: fo$(EXE) find_orb$(EXE) fo_serve.cgi

CFLAGS=-c -O3 -Wall -pedantic -Wextra -Wno-unused-parameter

OBJS=b32_eph.o bc405.o bias.o collide.o conv_ele.o eigen.o \
	elem2tle.o elem_out.o ephem0.o gauss.o geo_pot.o healpix.o \
	lsquare.o miscell.o moid4.o monte0.o mpc_obs.o mt64.o \
	orb_func.o orb_fun2.o pl_cache.o roots.o  \
	runge.o sigma.o sm_vsop.o sr.o $(OBJSADDED)

LIBS=-llunar -ljpl -lsatell

find_orb$(EXE):          findorb.o $(OBJS)
	$(CC) -o find_orb$(EXE) findorb.o $(OBJS) $(CURSES_LIB) $(LIBSADDED) $(LIBS)

fo$(EXE):          fo.o $(OBJS)
	$(CC) -o fo$(EXE) fo.o $(OBJS) $(LIBSADDED) $(LIBS)

fo_serve.cgi:          fo_serve.o cgi_func.o $(OBJS)
	$(CC) -o fo_serve.cgi fo_serve.o cgi_func.o $(OBJS) $(LIBSADDED) $(LIBS)

IDIR=$(HOME)/.find_orb

clean:
	$(RM) $(OBJS) fo.o findorb.o fo_serve.o find_orb$(EXE) fo$(EXE)
	$(RM) fo_serve.cgi cgi_func.o
	cd $(IDIR)
	$(RM) covar.txt covar?.txt debug.txt eleme?.txt elements.txt
	$(RM) ephemeri.txt gauss.out guide.txt guide?.txt monte.txt monte?.txt
	$(RM) mpc_f?.txt mpc_fmt.txt mpc_s?.txt mpec.htm obser?.txt observe.txt
	$(RM) residual.txt sr_el?.txt state.txt state?.txt virtu?.txt virtual.txt
	$(RM) sr_elems.txt mpcorb.dat

clean_temp:
	cd $(IDIR)
	$(RM) covar.txt covar?.txt debug.txt eleme?.txt elements.txt
	$(RM) ephemeri.txt gauss.out guide.txt guide?.txt monte.txt monte?.txt
	$(RM) mpc_f?.txt mpc_fmt.txt mpc_s?.txt mpec.htm obser?.txt observe.txt
	$(RM) residual.txt sr_el?.txt state.txt state?.txt virtu?.txt virtual.txt
	$(RM) sr_elems.txt mpcorb.dat

install:
	cp find_orb $(HOME)/bin
	-mkdir $(IDIR)
	cp command.txt details.txt dosephem.txt dos_help.txt ?findorb.txt           $(IDIR)
	cp environ.def geo_rect.txt header.htm jpl_eph.txt mpcorb.hdr               $(IDIR)
	cp mu1.txt observer.txt obslinks.htm ObsCodes.htm ObsCodesF.html            $(IDIR)
	cp  odd_name.txt rovers.txt scopes.txt sigma.txt xdesig.txt                 $(IDIR)

uninstall:
	rm -f $(HOME)/bin/find_orb
	rm -f $(IDIR)/*
	rmdir $(IDIR)

.cpp.o:
	$(CC) $(CFLAGS) $(ADDED_CFLAGS) $<