Mikmod make file?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Mikmod make file?

Post by Art »

Hi guys,
Does anyone have an example of a mikmod make file where they have
actually used it in a program?
I have the six include files in my project directory, and include "mikmod.h"
in my source code, but the example code to get a wav to play makes errors.
Thanx.
Art.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

I have a feeling that if I use this:

Code: Select all

# MikMod Library Makefile for DJGPP Linux
# Divine Entertainment Game Programming Pack


####################
### User Options ###
####################

# Use the C or C++ compiler
CC                = gcc 
CFLAGS  = -O2 -I. -I../include -g -DOSS

Lib_file          = ../lib/libmikmod.a

LoaderObjs        = mloader.o mlreg.o npertab.o sloader.o load_uni.o \
    load_mod.o load_m15.o load_mtm.o load_s3m.o load_stm.o load_669.o \
    load_far.o load_dsm.o load_med.o load_xm.o load_ult.o load_it.o \
    s3m_it.o

DriverObjs        = mdriver.o mdreg.o drv_nos.o drv_raw.o drv_wav.o \
	unix_drv/drv_oss.o 
# unix_drv/drv_AF.o unix_drv/drv_aix.o unix_drv/drv_hp.o
# unix_drv/drv_sun.o unix_drv/drv_sgi.o

PlayerObjs        = mplayer.o

####################
## Makefile rules ##
####################

all: $(Lib_file)

$(Lib_file): stream.o virtch.o munitrk.o \
	$(LoaderObjs) $(DriverObjs) $(PlayerObjs)
	ar r $(Lib_file) stream.o virtch.o munitrk.o \
        $(LoaderObjs) $(PlayerObjs) $(DriverObjs)

clean:
	rm -f *.o
	rm -f unix_drv/*.o
	rm -f $(Lib_file)
my program will stop working.
Samstag
Posts: 5
Joined: Thu Nov 24, 2005 10:41 am

Post by Samstag »

What specific problem are you having with the example program? If it's a runtime "can't open" error it's most likely because sound.wav is expected to be in the root of the memory stick. Either put it there or change "ms0:/sound.wav" to just "sound.wav" and put the file in the libmikmodtest folder.

When adding support to your own programs all you need to do is make sure you've got -lmikmod and -lpspaudio in the "LIBS=" section of your makefile and add #include "mikmod.h" to your C code.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Ok, thanx, I'll have another go with it tomorrow starting fresh :)
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

I wonder if anyone could help with a new Mikmod problem?
The modules I play are much louder than the samples I'm using.

Code: Select all

vol = 35;
Voice_SetVolume(voice, vol);
There's no problem adjusting the volume of samples with the above,
but how do I lower the volume of the music?
Cheers, Art.
Post Reply