2023-04-26 16:42:55 +02:00
|
|
|
# Makefile to build x48 without autotools
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
|
2023-04-30 15:14:17 +02:00
|
|
|
CFLAGS = -g -O2 #-Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wconversion -Wdouble-promotion -Wno-sign-conversion -fsanitize=undefined -fsanitize-trap
|
2023-04-26 16:42:55 +02:00
|
|
|
LIBS = -lm -lX11 -lXext -lhistory -lreadline
|
|
|
|
|
|
|
|
all: mkcard checkrom dump2rom x48
|
|
|
|
|
|
|
|
# Binaries
|
2023-04-26 16:58:42 +02:00
|
|
|
mkcard: src/mkcard.o
|
2023-04-26 16:48:46 +02:00
|
|
|
$(CC) $(CFLAGS) $(LIBS) $^ -o $@
|
2023-04-26 16:42:55 +02:00
|
|
|
|
2023-04-26 16:58:42 +02:00
|
|
|
dump2rom: src/dump2rom.o
|
2023-04-26 16:48:46 +02:00
|
|
|
$(CC) $(CFLAGS) $(LIBS) $^ -o $@
|
2023-04-26 16:42:55 +02:00
|
|
|
|
2023-04-26 16:58:42 +02:00
|
|
|
checkrom: src/checkrom.o src/romio.o
|
2023-04-26 16:48:46 +02:00
|
|
|
$(CC) $(CFLAGS) $(LIBS) $^ -o $@
|
2023-04-26 16:42:55 +02:00
|
|
|
|
2023-04-27 16:35:56 +02:00
|
|
|
x48: src/main.o src/actions.o src/debugger.o src/device.o src/disasm.o src/emulate.o src/errors.o src/init.o src/lcd.o src/memory.o src/register.o src/resources.o src/romio.o src/rpl.o src/serial.o src/timer.o src/x48_gui.o src/options.o src/resources.o
|
2023-04-26 16:48:46 +02:00
|
|
|
$(CC) $(CFLAGS) $(LIBS) $^ -o $@
|
2023-04-26 16:42:55 +02:00
|
|
|
|
|
|
|
# Cleaning
|
|
|
|
clean:
|
2023-04-26 16:48:46 +02:00
|
|
|
rm -f src/*.o
|
2023-04-26 16:42:55 +02:00
|
|
|
|
|
|
|
clean-all: clean
|
2023-04-26 16:48:46 +02:00
|
|
|
rm -f x48 mkcard checkrom dump2rom
|
2023-04-26 16:42:55 +02:00
|
|
|
|
|
|
|
# Formatting
|
|
|
|
pretty-code:
|
2023-04-26 16:48:46 +02:00
|
|
|
clang-format -i src/*.c src/*.h
|
2023-04-26 19:46:45 +02:00
|
|
|
|
|
|
|
# Installing
|
|
|
|
PREFIX = /usr
|
|
|
|
DOCDIR = $(PREFIX)/doc/x48
|
2023-04-26 22:49:47 +02:00
|
|
|
MANDIR = $(PREFIX)/man/man1
|
2023-04-26 19:46:45 +02:00
|
|
|
install: all
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -c -m 755 x48 $(DESTDIR)$(PREFIX)/bin/x48
|
|
|
|
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/x48
|
|
|
|
install -c -m 755 mkcard $(DESTDIR)$(PREFIX)/share/x48/mkcard
|
|
|
|
install -c -m 755 dump2rom $(DESTDIR)$(PREFIX)/share/x48/dump2rom
|
|
|
|
install -c -m 755 checkrom $(DESTDIR)$(PREFIX)/share/x48/checkrom
|
|
|
|
install -c -m 644 hplogo.png $(DESTDIR)$(PREFIX)/share/x48/hplogo.png
|
|
|
|
cp -R ROMs/ $(DESTDIR)$(PREFIX)/share/x48/
|
|
|
|
find $(DESTDIR)$(PREFIX)/share/x48/ROMs/ -name "*.bz2" -exec bunzip2 {} \;
|
2023-04-26 23:02:15 +02:00
|
|
|
sed "s|PREFIX|$(PREFIX)|g" setup-home.sh > $(DESTDIR)$(PREFIX)/share/x48/setup-x48-home.sh
|
|
|
|
chmod 755 $(DESTDIR)$(PREFIX)/share/x48/setup-x48-home.sh
|
2023-04-26 19:46:45 +02:00
|
|
|
|
2023-04-26 22:49:47 +02:00
|
|
|
install -m 755 -d -- $(DESTDIR)$(MANDIR)
|
2023-04-27 16:38:17 +02:00
|
|
|
install -c -m 644 x48.man.1 $(DESTDIR)$(MANDIR)/x48.1
|
2023-04-26 22:49:47 +02:00
|
|
|
gzip -9 $(DESTDIR)$(MANDIR)/x48.1
|
|
|
|
|
2023-04-26 19:46:45 +02:00
|
|
|
install -m 755 -d -- $(DESTDIR)$(DOCDIR)
|
|
|
|
cp -R AUTHORS COPYING ChangeLog INSTALL LICENSE README doc/ romdump/ $(DESTDIR)$(DOCDIR)
|
|
|
|
|
|
|
|
install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/applications
|
2023-04-26 23:02:15 +02:00
|
|
|
sed "s|PREFIX|$(PREFIX)|g" x48.desktop > $(DESTDIR)$(PREFIX)/share/applications/x48.desktop
|
2023-04-26 22:49:47 +02:00
|
|
|
|
|
|
|
install 0m 755 -d -- $(DESTDIR)/etc/X11/app-defaults
|
2023-04-27 16:38:17 +02:00
|
|
|
install -c -m 644 X48.ad $(DESTDIR)/etc/X11/app-defaults/X48
|