-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
124 lines (91 loc) · 2.51 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
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
# Makefile for GFALIST (c) Peter Backes
# Last modified by Markus Hoffmann 2014,2016
DISTRIB = ons
LIBNO=0.01
RELEASE=1
CC = gcc
# Cross-Compiler fuer MS WINDOWS
WINCC=i586-mingw32msvc-gcc
# Cross-Compiler fuer ATARI ST TOS
TOSCC=m68k-atari-mint-gcc
CFLAGS = -g3 -O2 -Wall
LFLAGS = -L.
# Directories
prefix=/usr
exec_prefix=${prefix}
BINDIR=${exec_prefix}/bin
MANDIR=${prefix}/share/man
# Precious targets
PRECIOUS = version.h
TARGETS = libsky.a gfalist
SKY_ARC = libsky.a(sky.o) libsky.a(tables.o)
SKY_OBJS = sky.o tables.o
GFALIST_OBJS = gfalist.o charset.o
OBJS = $(SKY_OBJS) $(GFALIST_OBJS)
# Headerfiles which should be added to the distribution
HSRC=charset.h sky.h tables.h
CSRC= $(OBJS:.o=.c)
BINDIST= gfalist
TRASH = core ons.spec.OLD
all: $(PRECIOUS) $(TARGETS)
libsky.a: $(SKY_OBJS)
$(AR) rcv $@ $?
ranlib $@
# Updating on a per file basis:
#libsky.a: $(SKY_ARCH) $(SKY_OBJS)
# ranlib $@
#(%.o): %.o
# $(AR) rcv $@ $<
# Updating with intermediate files:
#libsky.a: $(SKY_ARCH)
# ranlib $@
#(%.o): %.c
# $(CC) $(CFLAGS) -c $< -o $*.o
# $(AR) rcv $@ $*.o
# rm $*.o
gfalist: $(GFALIST_OBJS)
$(CC) $(LFLAGS) $+ -o $@ -lsky
gfalist.exe: $(CSRC)
$(WINCC) $+ -o $@
gfalist.ttp: $(CSRC)
$(TOSCC) $+ -o $@
version.h: HISTORY verextr.sh $(SKY_OBJS)
sh verextr.sh -g $< $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJS) $(TRASH)
realclean: clean
rm -f $(TARGETS) gfalist.exe gfalist.ttp gfalist_$(LIBNO)-$(RELEASE)_*.deb
clobber: realclean
rm -f $(PRECIOUS)
dist: MANIFEST HISTORY packdist.sh
sh packdist.sh -t $(DISTRIB) -m $< -v HISTORY,version.h -s ons.spec ck md
# For the debin package (created with checkinstall)
# Documentation files to be packed into the .deb file:
DEBDOC = README COPYING HISTORY
doc-pak : $(DEBDOC)
mkdir $@
cp $(DEBDOC) $@/
install : gfalist gfalist.1
install -s -m 755 gfalist $(BINDIR)/
install -m 644 gfalist.1 $(MANDIR)/man1/gfalist.1
uninstall :
rm -f $(BINDIR)/gfalist
rm -f $(MANDIR)/man1/gfalist.1
deb : $(BINDIST) doc-pak
sudo checkinstall -D --pkgname gfalist --pkgversion $(LIBNO) \
--pkgrelease $(RELEASE) \
--maintainer [email protected] \
--backup \
--pkggroup interpreters \
--pkglicense GPL --strip=yes --stripso=yes --reset-uids
rm -rf backup-*.tgz doc-pak
rpms: dist
sh packdist.sh -t $(DISTRIB) -v HISTORY,version.h mr
ons.spec: README HISTORY packdist.sh
sh packdist.sh -a README -v HISTORY,version.h -t $(DISTRIB) -s ons.spec fs
#DEPEND
gfalist: libsky.a
sky.o: sky.c sky.h tables.h
gfalist.o: gfalist.c $(HSRC) version.h