Skip to content

Commit

Permalink
add makefile for dos.
Browse files Browse the repository at this point in the history
  • Loading branch information
crazii committed Dec 20, 2023
1 parent a601db3 commit bb7c69b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions makefile.dos
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
TARGET := output/sbemu.exe
CC := gcc
CXX := gxx
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 := sc_null.c sc_sb16.c sc_sbpro.c sc_gus.c sc_ess.c sc_midas.c sc_wav.c sc_winds.c sc_winwo.c sc_wss.c

SRC := $(notdir $(shell dir *.c /b/s) $(shell dir *.cpp /b/s))
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)
Binary file modified sbemu.gdt
Binary file not shown.
Binary file modified sbemu.gpr
Binary file not shown.

0 comments on commit bb7c69b

Please sign in to comment.