forked from crazii/SBEMU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.dos
65 lines (49 loc) · 1.16 KB
/
makefile.dos
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
TARGET := output/sbemu.exe
CC := gcc
CXX := gxx
ifeq ($(DEBUG),)
override DEBUG = 0
endif
DEBUG ?= 0
VERSION ?= LOCAL_DOS
RM := del
INCLUDES := -I./mpxplay -I./sbemu
DEFINES := -D__DOS__ -DSBEMU -DDEBUG=$(DEBUG) -DMAIN_SBEMU_VER=\"$(VERSION)\"
CFLAGS := -fcommon -march=i386 -Os $(INCLUDES) $(DEFINES)
LDFLAGS := -lstdcxx -lm
ifeq ($(DEBUG),0)
LDFLAGS += -s
CFLAGS += -DNDEBUG
endif
ifeq ($(V),1)
SILENTCMD :=
SILENTMSG := @echo > nul
else
SILENTCMD := @
SILENTMSG := @echo
endif
VPATH += .
VPATH += sbemu
VPATH += sbemu/dpmi
VPATH += sbemu/dpmi/djgpp
VPATH += mpxplay/au_cards
all: $(TARGET)
EXCLUDE :=
SRC := $(notdir $(shell dir *.c /b/s/l/-p) $(shell dir *.cpp /b/s/l/-p))
SRC := $(filter-out $(EXCLUDE), $(SRC))
OBJS := $(patsubst %.cpp,output/%.o,$(patsubst %.c,output/%.o,$(SRC)))
$(TARGET): $(OBJS)
$(SILENTMSG) LINK $@
$(SILENTCMD)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
output/%.o: %.c
$(SILENTMSG) CC $@
$(SILENTCMD)$(CC) $(CFLAGS) -c $< -o $@
output/%.o: %.cpp
$(SILENTCMD)$(SILENTMSG) CXX $@
$(SILENTCMD)$(CXX) $(CFLAGS) -c $< -o $@
clean:
$(SILENTMSG) CLEAN
$(SILENTCMD)$(RM) output\*.o
distclean: clean
$(SILENTMSG) DISTCLEAN
$(SILENTCMD)$(RM) $(TARGET)