X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=Makefile.dj;h=e24955357563cccfcbab1ac1d8f3aef69d52d264;hp=f2414dcb7f27bb8d234eae50a7d4841db4835772;hb=0ce0f59d2afd26e0956716fae169075368020a02;hpb=637ca39c29b03bd3a2beb99521753e83c043283f diff --git a/Makefile.dj b/Makefile.dj index f2414dc..e249553 100644 --- a/Makefile.dj +++ b/Makefile.dj @@ -1,10 +1,11 @@ src = $(wildcard src/*.c) $(wildcard src/scr/*.c) $(wildcard src/dos/*.c) asmsrc = $(wildcard src/*.asm) $(wildcard src/scr/*.asm) $(wildcard src/dos/*.asm) -obj = $(src:.c=.cof) $(asmsrc:.asm=.cof) -dep = $(obj:.cof=.dep) +obj = $(src:.c=.odj) $(asmsrc:.asm=.odj) +dep = $(obj:.odj=.dep) bin = demo.exe asmsrc += cspr/dbgfont.asm cspr/confont.asm +bindata = data/loading.img ifeq ($(findstring COMMAND.COM, $(SHELL)), COMMAND.COM) hostsys = dos @@ -15,10 +16,15 @@ endif inc = -Isrc -Isrc/scr -Isrc/dos -Ilibs -Ilibs/imago/src -Ilibs/anim/src opt = -O3 -ffast-math -fno-strict-aliasing -dbg = -g -#prof = -pg warn = -pedantic -Wall -Wno-unused-function -Wno-unused-variable -def = -DNO_MUSIC + +ifdef RELEASE + dbg = -g + def = -DNDEBUG -DNO_MUSIC +else + def = -DNO_MUSIC +endif +#prof = -pg CC = $(TOOLPREFIX)gcc AR = $(TOOLPREFIX)ar @@ -33,40 +39,42 @@ endif $(bin): $(obj) imago anim $(CC) -o $@ -Wl,-Map=ld.map $(prof) $(obj) $(LDFLAGS) -%.cof: %.asm +%.odj: %.asm nasm -f coff -o $@ $< +src/data.odj: src/data.asm $(bindata) + ifneq ($(hostsys), dos) -include $(dep) endif -%.cof: %.c +%.odj: %.c $(CC) $(CFLAGS) -o $@ -c $< %.dep: %.c @echo dep $@ - @$(CPP) $(CFLAGS) $< -MM -MT $(@:.dep=.cof) >$@ + @$(CPP) $(CFLAGS) $< -MM -MT $(@:.dep=.odj) >$@ .PHONY: imago imago: - $(MAKE) -C libs/imago -f Makefile.dj + $(MAKE) -C libs/imago -f Makefile .PHONY: anim anim: - $(MAKE) -C libs/anim -f Makefile.dj + $(MAKE) -C libs/anim -f Makefile .PHONY: cleanlibs cleanlibs: - $(MAKE) -C libs/imago -f Makefile.dj clean - $(MAKE) -C libs/anim -f Makefile.dj clean + $(MAKE) -C libs/imago -f Makefile clean + $(MAKE) -C libs/anim -f Makefile clean .PHONY: clean .PHONY: cleandep ifeq ($(hostsys), dos) clean: - del src\*.cof - del src\dos\*.cof + del src\*.odj + del src\dos\*.odj del $(bin) cleandep: @@ -83,3 +91,7 @@ cleandep: data: @tools/procdata endif + +.PHONY: strip +strip: $(bin) + $(TOOLPREFIX)strip $(bin)