X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dos_sbtest;a=blobdiff_plain;f=Makefile;fp=Makefile;h=0b4be9eda629f130590c2029a20d51e2d7e8e78c;hp=118d4f045cf211ebe75bf8749e79bea644c958bb;hb=07c19444f4f2a55abf97d181ab62aeaa51033c62;hpb=01a545fde6dc446fe626382f8bba50b9b7c1a35b diff --git a/Makefile b/Makefile index 118d4f0..0b4be9e 100644 --- a/Makefile +++ b/Makefile @@ -1,56 +1,30 @@ -src = $(wildcard src/*.c) -ssrc = $(wildcard src/*.s) -asmsrc = $(wildcard src/*.asm) -obj = $(src:.c=.o) $(ssrc:.s=.o) $(asmsrc:.asm=.o) -dep = $(src:.c=.d) -bin = sbtest.exe - -ifeq ($(findstring COMMAND.COM, $(SHELL)), COMMAND.COM) - hostsys = dos -else - hostsys = unix - TOOLPREFIX = i586-pc-msdosdjgpp- -endif - -inc = -Isrc -opt = -O3 -ffast-math -fno-strict-aliasing -dbg = -g -warn = -pedantic -Wall -Wno-unused-function -Wno-unused-variable - -AS = $(TOOLPREFIX)as -CC = $(TOOLPREFIX)gcc -AR = $(TOOLPREFIX)ar -CFLAGS = $(warn) -march=pentium $(dbg) $(opt) $(inc) -LDFLAGS = - -$(bin): $(obj) - $(CC) -o $@ -Wl,-Map=ld.map $(obj) $(LDFLAGS) - -%.o: %.asm - nasm -f coff -o $@ $< - --include $(dep) - -%.o: %.c - $(CC) $(CFLAGS) -o $@ -c $< - -%.d: %.c - @echo "gen dep $< -> $@"; $(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ - -.PHONY: clean -.PHONY: cleandep - -ifeq ($(hostsys), dos) -clean: - del src\*.o - del $(bin) - -cleandep: - del src\*.d -else -clean: - rm -f $(obj) $(bin) - -cleandep: - rm -f $(dep) -endif +src = $(wildcard src/*.c) +#obj = $(src:.c=.obj) +obj = src\main.obj src\audio.obj src\au_sb.obj src\dma.obj +bin = sbtest.exe + +opt = -5 +dbg = -d1 + +incpath = -Isrc + +AS = nasm +CC = wcc386 +ASFLAGS = -fobj +CFLAGS = $(dbg) $(opt) $(def) -zq -bt=dos $(incpath) +LDFLAGS = option map +LD = wlink +RM = del + +$(bin): $(obj) + $(LD) debug all name $@ system dos4g file { $(obj) } $(LDFLAGS) + +%.obj: %.c + $(CC) -fo=$@ $(CFLAGS) $< + +%.obj: %.asm + $(AS) $(ASFLAGS) -o $@ $< + +clean: + $(RM) src\*.obj + $(RM) $(bin)