aboutsummaryrefslogtreecommitdiff
path: root/makefile.gnu
blob: 42845881bce67526b0bed22ad92795ebfded8269 (plain)
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#
# Automagically generated by Approximatrix Simply Fortran 3.11
#
FC?="gfortran"
CC?="/usr/bin/gcc"
AR?="ar"
WRC?="windres"
RM=rm -f

DESTDIR?=/usr/local

IDIR=

LDIR=


OPTFLAGS= -g

SPECIALFLAGS=$(IDIR)

RCFLAGS=-O coff

PRJ_FFLAGS=

PRJ_CFLAGS=

PRJ_LFLAGS=-lssl -lcrypto -lpthread -ldl

FFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_FFLAGS) -Jmodules 

CFLAGS=$(SPECIALFLAGS) $(OPTFLAGS) $(PRJ_CFLAGS)

build:
	mkdir -p $@

modules:
	mkdir -p $@

.PHONY: all clean

build/dumb_render.o: dumb_render.f90 modules/render.mod | modules build
	@echo Compiling dumb_render.f90
	@$(FC) -c -o "build/dumb_render.o" $(FFLAGS) "dumb_render.f90"
modules/dumb_render.mod : | modules build/dumb_render.o

build/escape.o: escape.f90 | modules build
	@echo Compiling escape.f90
	@$(FC) -c -o "build/escape.o" $(FFLAGS) "escape.f90"
modules/escaper.mod : | modules build/escape.o

build/files.o: files.f90 modules/layout.mod | modules build
	@echo Compiling files.f90
	@$(FC) -c -o "build/files.o" $(FFLAGS) "files.f90"
modules/file_handling.mod : | modules build/files.o

build/history.o: history.f90 | modules build
	@echo Compiling history.f90
	@$(FC) -c -o "build/history.o" $(FFLAGS) "history.f90"
modules/history.mod : | modules build/history.o

build/jessl.o: jessl.f90 | modules build
	@echo Compiling jessl.f90
	@$(FC) -c -o "build/jessl.o" $(FFLAGS) "jessl.f90"
modules/jessl.mod : | modules build/jessl.o

build/layout.o: layout.f90 modules/render.mod | modules build
	@echo Compiling layout.f90
	@$(FC) -c -o "build/layout.o" $(FFLAGS) "layout.f90"
modules/layout.mod : | modules build/layout.o

build/main.o: main.F90 modules/request.mod modules/dumb_render.mod modules/gemini_protocol.mod modules/layout.mod modules/file_handling.mod modules/history.mod | modules build
	@echo Compiling main.F90
	@$(FC) -c -o "build/main.o" $(FFLAGS) "main.F90"

build/network.o: network.F90 | modules build
	@echo Compiling network.F90
	@$(FC) -c -o "build/network.o" $(FFLAGS) "network.F90"
modules/network.mod : | modules build/network.o

build/protocol.o: protocol.f90 modules/request.mod modules/file_handling.mod | modules build
	@echo Compiling protocol.f90
	@$(FC) -c -o "build/protocol.o" $(FFLAGS) "protocol.f90"
modules/gemini_protocol.mod : | modules build/protocol.o

build/render.o: render.f90 modules/escaper.mod | modules build
	@echo Compiling render.f90
	@$(FC) -c -o "build/render.o" $(FFLAGS) "render.f90"
modules/render.mod : | modules build/render.o

build/request.o: request.f90 modules/network.mod modules/jessl.mod | modules build
	@echo Compiling request.f90
	@$(FC) -c -o "build/request.o" $(FFLAGS) "request.f90"
modules/request.mod : | modules build/request.o

clean:
	@echo Deleting build/dumb_render.o and related files
	@$(RM) "build/dumb_render.o" "modules/dumb_render.mod" "modules/dumb_render.smod"
	@echo Deleting build/escape.o and related files
	@$(RM) "build/escape.o" "modules/escaper.mod" "modules/escaper.smod"
	@echo Deleting build/files.o and related files
	@$(RM) "build/files.o" "modules/file_handling.mod" "modules/file_handling.smod"
	@echo Deleting build/history.o and related files
	@$(RM) "build/history.o" "modules/history.mod" "modules/history.smod"
	@echo Deleting build/jessl.o and related files
	@$(RM) "build/jessl.o" "modules/jessl.mod" "modules/jessl.smod"
	@echo Deleting build/layout.o and related files
	@$(RM) "build/layout.o" "modules/layout.mod" "modules/layout.smod"
	@echo Deleting build/main.o and related files
	@$(RM) "build/main.o"
	@echo Deleting build/network.o and related files
	@$(RM) "build/network.o" "modules/network.mod" "modules/network.smod"
	@echo Deleting build/protocol.o and related files
	@$(RM) "build/protocol.o" "modules/gemini_protocol.mod" "modules/gemini_protocol.smod"
	@echo Deleting build/render.o and related files
	@$(RM) "build/render.o" "modules/render.mod" "modules/render.smod"
	@echo Deleting build/request.o and related files
	@$(RM) "build/request.o" "modules/request.mod" "modules/request.smod"
	@echo Deleting build/test.o and related files
	@$(RM) "build/test.o"
	@echo Deleting build/test_ssl.o and related files
	@$(RM) "build/test_ssl.o"
	@echo Deleting directory modules
	@rmdir modules
	@echo Deleting directory build
	@rmdir build
	@echo Deleting lr87
	@$(RM) "lr87"

lr87:  build/dumb_render.o build/escape.o build/files.o build/history.o build/jessl.o build/layout.o build/main.o build/network.o build/protocol.o build/render.o build/request.o
	@echo Generating lr87
	@$(FC) -o "lr87" build/dumb_render.o build/escape.o build/files.o build/history.o build/jessl.o build/layout.o build/main.o build/network.o build/protocol.o build/render.o build/request.o $(LDIR) $(PRJ_LFLAGS)

all: lr87 

$(DESTDIR)/bin/lr87: lr87
	mkdir -p $(DESTDIR)/bin
	cp lr87 $(DESTDIR)/bin
$(DESTDIR)/share/lr87/LICENSE.txt: LICENSE.txt
	mkdir -p $(DESTDIR)/share/lr87
	cp LICENSE.txt $(DESTDIR)/share/lr87
$(DESTDIR)/share/lr87/README.md: README.md
	mkdir -p $(DESTDIR)/share/lr87
	cp README.md $(DESTDIR)/share/lr87
    
install: $(DESTDIR)/bin/lr87 $(DESTDIR)/share/lr87/LICENSE.txt $(DESTDIR)/share/lr87/README.md