-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
96 lines (73 loc) · 1.66 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
PREFIX=/usr/local
EXESUFFIX=
SOCKETLIBS=
# for cygwin
#EXESUFFIX=.exe
# for solaris:
#SOCKETLIBS = -lsocket -lnsl
CC=gcc
CFLAGS=-O3 -Wall `sdl-config --cflags` -DPREFIX=\"$(PREFIX)\"
LDFLAGS=`sdl-config --libs` $(SOCKETLIBS)
OBJS= \
kernal.o \
gfx.o \
net.o \
config.o \
keyboard.o \
menu.o \
font.o \
timer.o \
crc.o \
sound.o \
macro.o \
ui.o
TERMOBJS= \
xfer.o \
xmodem.o \
punter.o \
diskimage.o \
dir.o \
fileselector.o \
ui_term.o
CHATOBJS= \
chat.o \
status.o \
ui_chat.o
EDITOBJS= \
ui_edit.o \
fileselector.o \
dir.o \
diskimage.o
%.o: %c
$(CC) $(CFLAGS) -c $<
.PHONY: install installdirs clean
all: cgterm cgchat cgedit testkbd
cgterm: cgterm.o $(OBJS) $(TERMOBJS)
$(CC) -o cgterm $^ $(LDFLAGS)
cgchat: cgchat.o $(OBJS) $(CHATOBJS)
$(CC) -o cgchat $^ $(LDFLAGS)
cgedit: cgedit.o $(OBJS) $(EDITOBJS)
$(CC) -o cgedit $^ $(LDFLAGS)
testkbd: testkbd.o
$(CC) -o testkbd $^ $(LDFLAGS)
testimage: testimage.c diskimage.c dir.c
$(CC) -g -O3 -Wall -o testimage $^
install: all installdirs
strip cgterm$(EXESUFFIX)
strip cgchat$(EXESUFFIX)
strip cgedit$(EXESUFFIX)
cp cgterm$(EXESUFFIX) $(PREFIX)/bin/
cp cgchat$(EXESUFFIX) $(PREFIX)/bin/
cp cgedit$(EXESUFFIX) $(PREFIX)/bin/
cp *.bmp *.kbd *.wav $(PREFIX)/share/cgterm/
installdirs: $(PREFIX)/bin $(PREFIX)/share $(PREFIX)/share/cgterm $(PREFIX)/etc
$(PREFIX)/bin:
mkdir $(PREFIX)/bin > /dev/null 2>&1
$(PREFIX)/share:
mkdir $(PREFIX)/share > /dev/null 2>&1
$(PREFIX)/share/cgterm:
mkdir $(PREFIX)/share/cgterm > /dev/null 2>&1
$(PREFIX)/etc:
mkdir $(PREFIX)/etc > /dev/null 2>&1
clean:
rm -f cgterm$(EXESUFFIX) cgchat$(EXESUFFIX) cgedit$(EXESUFFIX) testkbd$(EXESUFFIX) *.o *~