-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNmakefile
64 lines (50 loc) · 1.66 KB
/
Nmakefile
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
# Makefile
# $Id: Makefile,v 1.4 2006-07-13 01:39:31 hkuno Exp $
#----- rules -------------------------------------------------------------
RM=del
TARGET=sunmoon.exe
#CFLAGS=-W3 -MD -GX -O1 -nologo
CFLAGS=-W3 -MD -EHsc -O1 -nologo -D_CRT_SECURE_NO_WARNINGS
.cpp.obj:
cl $(CFLAGS) -c $<
.cpp.exe:
cl $(CFLAGS) -DTEST -Fotest.obj -Fe$*.exe $< astro.lib
#----- objects and sources -----------------------------------------------
SRC=vec3.cpp degree.cpp jday.cpp \
acoord.cpp atime.cpp \
planets.cpp
OBJ=$(SRC:.cpp=.obj)
#----- target ------------------------------------------------------------
all: $(TARGET)
# for Windows
sunmoon.exe: sunmoon.obj astro.lib
cl $(CFLAGS) $**
if exist $@.manifest mt /outputresource:"$@;#1" /manifest $@.manifest
astro.lib: $(OBJ)
lib /OUT:$@ $**
$(OBJ): $*.h defs.h Nmakefile
#----- test --------------------------------------------------------------
test: jday.test atime.test acoord.test planets.test
jday.test: $*.exe
perl -n -e "print if /^j/,/^g2000/;" jday.cpp >in.tmp
jday <in.tmp >out.tmp
diff -w in.tmp out.tmp
atime.test: $*.exe
perl -n -e "print if /^1997/../^1978/;" atime.cpp >in.tmp
atime <in.tmp >out.tmp
diff -w in.tmp out.tmp
acoord.test: $*.exe
perl -n -e "print if /^1996/../^1997.11/;" acoord.cpp >in.tmp
acoord <in.tmp >out.tmp
diff -w in.tmp out.tmp
planets.test: $*.exe
perl -n -e "print if /^1991/../^conv: l=229/;" planets.cpp >in.tmp
planets <in.tmp >out.tmp
diff -w in.tmp out.tmp
jday.exe atime.exe acoord.exe planet.exe: astro.lib
#----- util --------------------------------------------------------------
clean:
$(RM) *.obj *.lib *.o *.a *.bak *.tmp
cleanall: clean
$(RM) *.exe *.map *.out *.manifest
#end