forked from crazii/SBEMU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
90 lines (76 loc) · 1.99 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
TARGET := output/sbemu.exe
CC := i586-pc-msdosdjgpp-gcc
CXX := i586-pc-msdosdjgpp-g++
DEBUG ?= 0
VERSION ?= $(shell git describe --tags)
INCLUDES := -I./mpxplay -I./sbemu
DEFINES := -D__DOS__ -DSBEMU -DDEBUG=$(DEBUG) -DMAIN_SBEMU_VER=\"$(VERSION)\"
CFLAGS := -fcommon -march=i386 -Os $(INCLUDES) $(DEFINES)
LDFLAGS := -lstdc++ -lm
ifeq ($(DEBUG),0)
LDFLAGS += -s
CFLAGS += -DNDEBUG
endif
ifeq ($(V),1)
SILENTCMD :=
SILENTMSG := @true
else
SILENTCMD := @
SILENTMSG := @printf
endif
VPATH += .
VPATH += sbemu
VPATH += sbemu/dpmi
all: $(TARGET)
CARDS_SRC := mpxplay/au_cards/ac97_def.c \
mpxplay/au_cards/au_base.c \
mpxplay/au_cards/au_cards.c \
mpxplay/au_cards/dmairq.c \
mpxplay/au_cards/pcibios.c \
mpxplay/au_cards/sc_e1371.c \
mpxplay/au_cards/sc_ich.c \
mpxplay/au_cards/sc_cmi.c \
mpxplay/au_cards/sc_inthd.c \
mpxplay/au_cards/sc_sbl24.c \
mpxplay/au_cards/sc_sbliv.c \
mpxplay/au_cards/sc_via82.c \
mpxplay/au_cards/sc_sbxfi.c \
SBEMU_SRC := sbemu/dbopl.cpp \
sbemu/opl3emu.cpp \
sbemu/pic.c \
sbemu/sbemu.c \
sbemu/untrapio.c \
sbemu/vdma.c \
sbemu/virq.c \
sbemu/serial.c \
sbemu/dpmi/xms.c \
sbemu/dpmi/dpmi.c \
sbemu/dpmi/dbgutil.c \
sbemu/dpmi/dpmi_dj2.c \
sbemu/dpmi/dpmi_tsr.c \
sbemu/dpmi/djgpp/gormcb.c \
main.c \
qemm.c \
test.c \
utility.c \
hdpmipt.c \
SRC := $(CARDS_SRC) $(SBEMU_SRC)
OBJS := $(patsubst %.cpp,output/%.o,$(patsubst %.c,output/%.o,$(SRC)))
$(TARGET): $(OBJS)
@mkdir -p $(dir $@)
$(SILENTMSG) "LINK\t$@\n"
$(SILENTCMD)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
output/%.o: %.c
@mkdir -p $(dir $@)
$(SILENTMSG) "CC\t$@\n"
$(SILENTCMD)$(CC) $(CFLAGS) -c $< -o $@
output/%.o: %.cpp
@mkdir -p $(dir $@)
$(SILENTCMD)$(SILENTMSG) "CXX\t$@\n"
$(SILENTCMD)$(CXX) $(CFLAGS) -c $< -o $@
clean:
$(SILENTMSG) "CLEAN\n"
$(SILENTCMD)$(RM) $(OBJS)
distclean: clean
$(SILENTMSG) "DISTCLEAN\n"
$(SILENTCMD)$(RM) $(TARGET)