X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=Makefile.dj;h=2088717232d6d461202889f17edf3dfd6e999a76;hp=600403a98fb2b36355eac96e2f9adbae57015b1f;hb=8f7234e08947a80bace3643f37214c5fb076bdfe;hpb=0165ec15f868a16a70b56ada2d42db0cb69ea193 diff --git a/Makefile.dj b/Makefile.dj index 600403a..2088717 100644 --- a/Makefile.dj +++ b/Makefile.dj @@ -1,6 +1,7 @@ src = $(wildcard src/*.c) $(wildcard src/dos/*.c) -obj = $(src:.c=.o) -dep = $(obj:.o=.d) +asmsrc = $(wildcard src/*.asm) $(wildcard src/dos/*.asm) +obj = $(src:.c=.cof) $(asmsrc:.asm=.cof) +dep = $(obj:.cof=.dep) bin = demo.exe ifeq ($(findstring COMMAND.COM, $(SHELL)), COMMAND.COM) @@ -10,22 +11,29 @@ else TOOLPREFIX = i586-pc-msdosdjgpp- endif -inc = -Isrc -Isrc/dos -Ilibs/imago/src -Ilibs/oldmik/src -opt = -O3 -ffast-math +inc = -Isrc -Isrc/dos -Ilibs/imago/src -Ilibs/mikmod/include +opt = -O3 -ffast-math -fno-strict-aliasing dbg = -g +warn = -pedantic -Wall -Wno-unused-function -Wno-unused-variable CC = $(TOOLPREFIX)gcc AR = $(TOOLPREFIX)ar -CFLAGS = -pedantic -Wall $(dbg) $(opt) $(inc) -LDFLAGS = libs/imago/imago.a libs/oldmik/mikmod.a +CFLAGS = $(warn) -march=pentium $(dbg) $(opt) $(inc) +LDFLAGS = libs/imago/imago.dja libs/mikmod/dos/libmikmod.a $(bin): $(obj) imago mikmod $(CC) -o $@ -Wl,-Map=ld.map $(obj) $(LDFLAGS) +%.cof: %.asm + nasm -f coff -o $@ $< + -include $(dep) -%.d: %.c - @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ +%.cof: %.c + $(CC) $(CFLAGS) -o $@ -c $< + +%.dep: %.c + @$(CPP) $(CFLAGS) $< -MM -MT $(@:.dep=.cof) >$@ .PHONY: imago imago: @@ -33,25 +41,25 @@ imago: .PHONY: mikmod mikmod: - $(MAKE) -C libs/oldmik -f Makefile.dj + $(MAKE) -C libs/mikmod/dos -f Makefile.dj .PHONY: cleanlibs cleanlibs: $(MAKE) -C libs/imago -f Makefile.dj clean - $(MAKE) -C libs/oldmik -f Makefile.dj clean + $(MAKE) -C libs/mikmod/dos -f Makefile.dj clean .PHONY: clean .PHONY: cleandep ifeq ($(hostsys), dos) clean: - del src\*.o - del src\dos\*.o + del src\*.cof + del src\dos\*.cof del $(bin) cleandep: - del src\*.d - del src\dos\*.d + del src\*.dep + del src\dos\*.dep else clean: rm -f $(obj) $(bin)