-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.win
59 lines (42 loc) · 1.86 KB
/
Makefile.win
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
LIBCDIO_VERSION = 2.1.0
LIBCDIO_NAME = libcdio-$(LIBCDIO_VERSION)
HOST = i686-w64-mingw32
CC = ${HOST}-gcc
CXX = ${HOST}-g++
LD = ${HOST}-ld
WINDRES = ${HOST}-windres
target ?= efsextract
objects := $(patsubst %.c,%.o,$(wildcard *.c)) resource.o
#EXTRAS += -fsanitize=bounds -fsanitize=undefined -fsanitize=null -fcf-protection=full -fstack-protector-all -fstack-check -Wimplicit-fallthrough -fanalyzer -Wall
LDLIBS += -lws2_32 -lwinmm
LDFLAGS += -static ${EXTRAS}
CFLAGS += -flto -std=gnu2x -Og -ggdb -Ilibcdio-install/include ${EXTRAS}
.PHONY: all
all: $(target) README
strip $(target).exe
upx $(target).exe
.PHONY: clean
clean:
rm -f $(target) $(target).exe $(objects)
.PHONY: distclean
distclean: clean
rm -Rf libcdio-build libcdio-install $(LIBCDIO_NAME)
README: ${target}.1
MANWIDTH=77 man --nh --nj ./${target}.1 | col -b > $@
resource.o: resource.rc
$(WINDRES) $< -o $@
$(target): $(objects) libcdio-install/lib/libiso9660.a libcdio-install/lib/libudf.a libcdio-install/lib/libcdio.a
########################
########################
# libcdio stuff
########################
########################
$(objects): libcdio-install/lib/libcdio.a libcdio-install/lib/libiso9660.a libcdio-install/lib/libudf.a
libcdio-install/lib/libcdio.a libcdio-install/lib/libiso9660.a: libcdio-build/Makefile
$(MAKE) -C libcdio-build install MAKEFLAGS=
libcdio-build/Makefile: $(LIBCDIO_NAME)/configure
mkdir -p libcdio-build
cd libcdio-build && ../$(LIBCDIO_NAME)/configure --disable-shared --enable-static --without-cd-drive --without-cd-info --without-cdda-player --without-cd-read --without-iso-info --without-iso-read --disable-cxx --disable-joliet --disable-rock --disable-cddb --disable-vcd-info --disable-example-progs --disable-cpp-progs --prefix="`realpath ../libcdio-install`" --host=${HOST}
$(LIBCDIO_NAME)/configure: libraries/$(LIBCDIO_NAME).tar.gz
tar -zxvf $<
touch $@