-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (42 loc) · 1.44 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
#
# Copyright (C) 2023 Yuichi Nakamura (@yunkya2)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
CROSS = m68k-xelf-
CC = $(CROSS)gcc
AS = $(CROSS)gcc
LD = $(CROSS)gcc
AR = $(CROSS)ar
RANLIB = $(CROSS)ranlib
OBJCOPY = $(CROSS)objcopy
GIT_REPO_VERSION=$(shell git describe --tags --always)
CFLAGS = -g -std=gnu99 -O
CFLAGS += -finput-charset=utf-8 -fexec-charset=cp932
OBJS = gdbserver.o utils.o packets.o ptrace.o
all: gdbserver.x
gdbserver.x: $(OBJS)
$(CC) -o $@ $^
gdbserver.o : gdbserver.c arch.h utils.h packets.h ptrace.h
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
-rm -rf *.o *.x* build
RELFILE := gdbserver-x68k-$(GIT_REPO_VERSION).zip
release: all
rm -rf build && mkdir build
cat README.68k | sed "s/\$$(VERSION)/$(GIT_REPO_VERSION)/" | iconv -f utf-8 -t cp932 > build/README.txt
cp gdbserver.x build
(cd build; zip -r ../$(RELFILE) *)
.PHONY: all clean release