forked from matthewarcus/mmps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
91 lines (64 loc) · 2 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
# $Revision: 1.7 $
# MMPS main makefile
EXES := project addgrid stars testimage circularize combine
OBJS := matrix.o transform.o equations.o utils.o image.o
all: $(EXES)
ppms:
cd images; mogrify -format ppm `ls *.jpg *.gif *.png 2> /dev/null || true`
test: project images/earth.ppm
./project perspective -lat 20 -long 30 -x 6 -sun -date 172 -time 3.83 -f images/earth.ppm | display
test2: project images/earth.ppm
./project gnomonic -lat 52.2 -dlat 52.2 -grid \
-color darkyellow -tropics -temporaryhours \
-color darkred -analemma \
-color orange -altitudes \
-color red -dateline 91.583 -datetime 91.583 \
-f images/earth.ppm | display
test3: project images/earth.ppm
./project mercator -tilt 90 -grid -gridx 20 -gridy 20 -color 255:0:0 -grid -scale 2 -f images/earth.ppm | display -rotate 270 -
startest: stars
cat starlist | ./stars -ra 5.24 -dec -8.2 | display
startest2: stars
cat starlist | ./stars hammer -grid -gridx 20 -gridy 20 -w 1024 -adjust | display
images/%.ppm: images/%.jpg
convert -format ppm $< $@
release:
$(MAKE) -f Makefile.release $@
.PHONY: startest startest2 test ppms release
# Generic after here
CC := g++
OPTIMIZE := -O3
WARN := -Wall -Wshadow
ifeq (EXTRAWARNINGS,true)
WARN += -W -Wold-style-cast
WARN += -Woverloaded-virtual -Wsign-promo -Wundef -Wcast-align
WARN += -Wwrite-strings -Wconversion
#WARN += -Weffc++
endif
DEFS :=
$(EXES): %: %.o $(OBJS)
CFLAGS = -g -MMD -MP -ansi $(WARN) $(OPTIMIZE) $(DEFS)
LDFLAGS = -lm
ifeq ($(PROFILE),true)
CFLAGS += -pg
LDFLAGS += -pg
endif
# Look for files in parent directory so we can compile in a subdirectory
vpath %.cpp ..
vpath %.h ..
# Include auto-generated dependency files
-include *.d
# Rule for all of our executables
$(EXES):
$(CC) $(LDFLAGS) -o $@ $^
# And a rule for .cpp files, just in case we don't have one.
%.o: %.cpp
$(CC) $(CFLAGS) -c -o $@ $<
%.a:
$(AR) -crs $@ $^
clean:
rm -f $(EXES)
rm -f *.o *.d *.a
purge: clean
rm -f *~ a.out gmon.out foo.* *.tgz image0*.ppm
.PHONY: all clean purge