--- /dev/null
+src = $(wildcard src/*.c)\r
+obj = $(src:.c=.o)\r
+dep = $(obj:.o=.d)\r
+\r
+ifeq ($(findstring COMMAND.COM, $(SHELL)), COMMAND.COM)\r
+ hostsys = dos\r
+else\r
+ hostsys = unix\r
+ TOOLPREFIX = i586-pc-msdosdjgpp-\r
+endif\r
+bin = auplay.exe\r
+\r
+warn = -pedantic -Wall\r
+opt = -march=pentium -O0\r
+dbg = -g\r
+def = -DLITTLEENDIAN\r
+\r
+incpath = -Isrc\r
+\r
+AS = nasm\r
+CC = $(TOOLPREFIX)gcc\r
+ASFLAGS = -f coff\r
+CFLAGS = $(dbg) $(opt) $(def) $(incpath)\r
+LDFLAGS = -Wl,-Map=ld.map\r
+LD = wlink\r
+\r
+$(bin): $(obj)\r
+ $(CC) -o $@ $(obj) $(LDFLAGS)\r
+\r
+-include $(dep)\r
+\r
+%.o: %.asm\r
+ $(AS) $(ASFLAGS) -o $@ $<\r
+\r
+%.d: %.c\r
+ @echo depfile $@\r
+ @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@\r
+\r
+.PHONY: clean\r
+.PHONY: cleandep\r
+\r
+ifeq ($(hostsys), dos)\r
+clean:\r
+ del src\*.o\r
+ del $(bin)\r
+\r
+cleandep:\r
+ del src\*.d\r
+else\r
+clean:\r
+ rm -f $(obj) $(bin)\r
+\r
+cleandep:\r
+ rm -f $(dep)\r
+endif\r