DRUID Development Docs: Makefile

File: Makefile

#
# Justice Unlimited Gadget Makefile
#
# Copyight (C) 2004, Nathan (Acorn) Pooley
#

default: all    ;   

help:
    echo "MAKEFILE FOR JUSTICE UNLIMITED GADGET"
    echo "-------------------------------------"
    echo "OPTIONS:"
    echo "   n=          - show all commands"
    echo ""
    echo "TARGETS:"
    echo "   all         - (default) files needed to build gadget"
    echo "   gcodes.sstr - build gcodes.sstr"
    echo "   ju_convert  - build ./ju_convert tool"
    echo "   bak         - make a backup of all files (uses ./do_bak)"
    echo "   docs        - make documentation files (uses ./do_doc)"
    echo "   qdocs       - make documentation files quickly (uses ./do_doc)"
    echo "   doc_install - copy documentation to rawbw server"
    echo "   help        - print this message"
    echo ""

PROGS   :=  ju_convert  \
            codegen2    \
            snd

DATA1   :=  gstrings.inc
DATA2   :=  gfuncs.inc      \
            gdefs.inc       \
            gschar.inc
DATA    :=  $(DATA1)        \
            $(DATA2)

OTHER   :=  tags
        
all: data progs other

data: $(DATA)   ;   
progs: $(PROGS) ;   
other: $(OTHER) ;   

.PHONY: progs data other all

$(DATA2) gdata.dep:
    \rm -f gstrings.inc gdata.dep

gstrings.inc: gadget_strings.str ju_convert $(DATA2)
    echo "Converting $@"
    ./ju_convert -i $< -s $@ -f gfuncs.inc -d gdefs.inc -c gschar.inc -p gdata.dep
    touch $@

gcodes.sstr: gadget_codes.sstr codegen2
    echo "Creating $@"
    ./codegen2 > $@

%: %.c
    echo "Compiling $@"
    gcc -g -o $@ $<

tags: $(PROGS)
    echo "Making tags"
    ctags *.c *.asm *.inc

force:  ;   

.PHONY: force help bak backup doc docs doc_install docs_install clean

bak backup:
    echo "creating backup"
    ./do_bak

doc docs:
    echo "creating documentation"
    ./do_doc

qdoc qdocs:
    echo "creating documentation (not updating source files)"
    ./do_doc -nosource

doc_install docs_install:
    echo "Copying docs to server"
    scp ju_gadget_docs/* destination

clean:
    echo "Cleaning"
    \rm -f gadget.COD gadget.HEX *.err *.o *.lst ju_convert.exe
    \rm -f *.seds *.dep

ifeq ($(strip $(findstring clean, $(MAKECMDGOALS))),)
-include gdata.dep
endif

n       :=  .SILENT
$(n) silent_dummy:

This file Copyright (C) 2004 by Nathan (Acorn) Pooley
Go to DRUID Development page
Go to DRUID page
Go to JU Gadgets page
Go to Justice Unlimited homepage
Go to Acorn's personal webpage
Contact Acorn
See comments from others
Post your own comments
File created by do_doc at Wed Aug 4 18:14:47 2004