fixed DJGPP makefile
authorJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 11 Aug 2020 15:40:57 +0000 (18:40 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 11 Aug 2020 15:40:57 +0000 (18:40 +0300)
Makefile.dj
src/scr/cybersun.c

index e249553..32ab4ae 100644 (file)
@@ -1,7 +1,8 @@
-src = $(wildcard src/*.c) $(wildcard src/scr/*.c) $(wildcard src/dos/*.c)
+src = $(wildcard src/*.c) $(wildcard src/3dgfx/*.c) $(wildcard src/scr/*.c) \
+         $(wildcard src/dos/*.c)
 asmsrc = $(wildcard src/*.asm) $(wildcard src/scr/*.asm) $(wildcard src/dos/*.asm)
 obj = $(src:.c=.odj) $(asmsrc:.asm=.odj)
-dep = $(obj:.odj=.dep)
+dep = $(src:.c=.d)
 bin = demo.exe
 
 asmsrc += cspr/dbgfont.asm cspr/confont.asm
@@ -14,7 +15,8 @@ else
        TOOLPREFIX = i586-pc-msdosdjgpp-
 endif
 
-inc = -Isrc -Isrc/scr -Isrc/dos -Ilibs -Ilibs/imago/src -Ilibs/anim/src
+inc = -Isrc -Isrc/3dgfx -Isrc/scr -Isrc/dos -Ilibs \
+         -Ilibs/imago/src -Ilibs/anim/src -Ilibs/midas
 opt = -O3 -ffast-math -fno-strict-aliasing
 warn = -pedantic -Wall -Wno-unused-function -Wno-unused-variable
 
@@ -28,8 +30,8 @@ endif
 
 CC = $(TOOLPREFIX)gcc
 AR = $(TOOLPREFIX)ar
-CFLAGS = $(warn) -march=pentium $(dbg) $(opt) $(prof) $(inc) $(def)
-LDFLAGS = libs/imago/imago.dja libs/anim/anim.dja
+CFLAGS = -march=pentium $(warn) -MMD $(dbg) $(opt) $(prof) $(inc) $(def)
+LDFLAGS = libs/imago/imago.dja libs/anim/anim.dja libs/midas/libmidas.a
 
 ifneq ($(hostsys), dos)
 .PHONY: all
@@ -44,29 +46,23 @@ $(bin): $(obj) imago anim
 
 src/data.odj: src/data.asm $(bindata)
 
-ifneq ($(hostsys), dos)
 -include $(dep)
-endif
 
 %.odj: %.c
        $(CC) $(CFLAGS) -o $@ -c $<
 
-%.dep: %.c
-       @echo dep $@
-       @$(CPP) $(CFLAGS) $< -MM -MT $(@:.dep=.odj) >$@
-
 .PHONY: imago
 imago:
-       $(MAKE) -C libs/imago -f Makefile
+       $(MAKE) -C libs/imago -f Makefile.dj
 
 .PHONY: anim
 anim:
-       $(MAKE) -C libs/anim -f Makefile
+       $(MAKE) -C libs/anim -f Makefile.dj
 
 .PHONY: cleanlibs
 cleanlibs:
-       $(MAKE) -C libs/imago -f Makefile clean
-       $(MAKE) -C libs/anim -f Makefile clean
+       $(MAKE) -C libs/imago clean -f Makefile.dj
+       $(MAKE) -C libs/anim clean -f Makefile.dj
 
 .PHONY: clean
 .PHONY: cleandep
@@ -74,12 +70,14 @@ cleanlibs:
 ifeq ($(hostsys), dos)
 clean:
        del src\*.odj
+       del src\3dgfx\*.odj
        del src\dos\*.odj
        del $(bin)
 
 cleandep:
-       del src\*.dep
-       del src\dos\*.dep
+       del src\*.d
+       del src\3dgfx\*.d
+       del src\dos\*.d
 else
 clean:
        rm -f $(obj) $(bin)
index 6cd9f6a..e150cab 100644 (file)
@@ -162,7 +162,8 @@ static void draw_mountains(void)
        int32_t x, xstart, xend, dx;
        uint16_t *dptr, *sptr;
 
-       xstart = cround64(cam_theta * (256.0 * 512.0 / 90.0));  /* 24.8 fixed point, 512 width */
+       /* 24.8 fixed point, 512 width, 90deg arc */
+       xstart = cround64(cam_theta * (256.0 * 512.0 / 90.0));
        xend = cround64((cam_theta + HFOV) * (256.0 * 512.0 / 90.0));
        dx = (xend - xstart) / FB_WIDTH;
        x = xstart;