-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 loc) · 1.29 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
.POSIX:
.SUFFIXES:
CC = gcc
FC = gfortran
AR = ar
PREFIX = /usr/local
DEBUG = # -ggdb3 -O0
FFLAGS = $(DEBUG) -Wall -Wno-unused-dummy-argument -std=f2008 -fmax-errors=1 -fcheck=all
LDFLAGS = -I$(PREFIX)/include/ -L$(PREFIX)/lib/
LDLIBS = -lXm -lXt -lX11
ARFLAGS = -cr
XLIB = xlib.o
XT = xt.o
XM = xm.o
XMHTML = xmhtml.o
TARGET = libfortran-motif.a
BITMAP = examples/bitmap/bitmap
CLICK = examples/click/click
WWW = examples/www/www
.PHONY: all bitmap clean click www xmhtml
all: $(XLIB) $(XM) $(XT) $(XMHTML)
$(AR) $(ARFLAGS) $(TARGET) xlib.o xm.o xt.o xmhtml.o
motif: $(XLIB) $(XM) $(XT)
$(AR) $(ARFLAGS) $(TARGET) xlib.o xm.o xt.o
# Modules.
$(XLIB):
$(FC) $(FFLAGS) -c src/x11/xlib.f90
$(XM):
$(FC) $(FFLAGS) -c src/xm/xm.f90
$(XT):
$(FC) $(FFLAGS) -c src/xt/xt.f90
$(XMHTML):
$(FC) $(FFLAGS) -c src/xmhtml/xmhtml.f90
# Examples.
bitmap: motif
$(FC) $(FFLAGS) $(LDFLAGS) -o $(BITMAP) $(BITMAP).f90 $(TARGET) $(LDLIBS) -lXpm
click: motif
$(FC) $(FFLAGS) $(LDFLAGS) -o $(CLICK) $(CLICK).f90 $(TARGET) $(LDLIBS)
www: all
$(FC) $(FFLAGS) $(LDFLAGS) -o $(WWW) $(WWW).f90 $(TARGET) $(LDLIBS) -lXpm -lXmHTML
clean:
rm *.mod *.o *.a
if [ -e $(BITMAP) ]; then rm $(BITMAP); fi
if [ -e $(CLICK) ]; then rm $(CLICK); fi
if [ -e $(WWW) ]; then rm $(WWW); fi