-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (65 loc) · 1.92 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
-include config.mk
INPUT = EV_Nova.dat
OUTPUT = EV\ Nova.exe
LDS = EV_Nova.lds
LDFLAGS ?= -Wl,--subsystem=windows -Wl,--disable-nxcompat -Wl,--disable-reloc-section -Wl,--enable-stdcall-fixup -static -mcrtdll=msvcrt-os
ASFLAGS ?= -Iinc
NFLAGS ?= -Iinc -f elf
CFLAGS ?= -Iinc -O2 -march=pentium4 -Wall -masm=intel
CXXFLAGS ?= -Iinc -O2 -march=pentium4 -Wall -masm=intel
LIBS = -lgdi32 -lgdiplus -lcnc_ddraw
OBJS = res/res.o \
sym.o \
src/winmain.o \
src/blitters.o \
src/debug-mode.o \
src/dynamic-resolution.o \
src/font-substitution-fix.o \
src/hotkeys.o \
src/hotkeys-x2.o \
src/hyperspace-effects.o \
src/k.o \
src/macroman-fix.o \
src/map-borders.o \
src/map-borders2.o \
src/mission-bbs-title-fix.o \
src/nebu-sizes.o \
src/no-encryption.o \
src/open-pilot-fix.o \
src/odd-width-fix.o \
src/particle-cap.o \
src/paths.o \
src/ppat-decoder.o \
src/scale-dlog.o \
src/scale-grid.o \
src/scale-status-bar.o \
src/version.o \
src/widescreen-roid-fix.o \
src/windowed-toggle.o \
src/windows-keys-fix.o \
src/wndproc.o \
src/vsnprintf.o \
src/wine.o
CC = i686-w64-mingw32-gcc
CXX = i686-w64-mingw32-g++
AS = i686-w64-mingw32-as
STRIP ?= i686-w64-mingw32-strip
WINDRES ?= i686-w64-mingw32-windres
PETOOL ?= petool
NASM ?= nasm
IAT = 12 0x18F5C8 1220
all: $(OUTPUT)
%.o: %.asm
$(NASM) $(NFLAGS) -o $@ $<
%.o: %.rc
$(WINDRES) $(WFLAGS) $< $@
rsrc.o: $(INPUT)
$(PETOOL) re2obj $< $@
$(OUTPUT): $(OBJS)
$(CXX) $(LDFLAGS) -T $(LDS) -o "$@" $^ $(LIBS)
$(PETOOL) setdd "$@" $(IAT) || ($(RM) "$@" && exit 1)
$(PETOOL) setsc "$@" .p_text 0x60000020 || ($(RM) "$@" && exit 1)
$(PETOOL) patch "$@" || ($(RM) "$@" && exit 1)
$(STRIP) -R .patch "$@" || ($(RM) "$@" && exit 1)
clean:
$(RM) $(OUTPUT) $(OBJS)