2008-02-19 09:49:12 +00:00
|
|
|
PROGRAMS=justnukeit
|
|
|
|
|
2008-02-20 00:25:08 +00:00
|
|
|
justnukeit_OBJS= \
|
|
|
|
Position \
|
2008-02-22 22:49:21 +00:00
|
|
|
Timeline \
|
2008-03-03 18:14:42 +00:00
|
|
|
Mouse \
|
|
|
|
Joystick \
|
|
|
|
Keyboard \
|
2008-02-22 22:49:21 +00:00
|
|
|
Menu \
|
|
|
|
Level \
|
2008-02-20 00:25:08 +00:00
|
|
|
Player \
|
2008-03-03 18:14:42 +00:00
|
|
|
Video \
|
2008-02-20 09:36:35 +00:00
|
|
|
Game \
|
2008-02-20 00:25:08 +00:00
|
|
|
main
|
|
|
|
|
2008-02-19 09:49:12 +00:00
|
|
|
justnukeit_INCS=sdl
|
2008-02-19 13:25:52 +00:00
|
|
|
justnukeit_LIBS=graphics unix threads bigarray sdl sdlloader sdlttf
|
2008-02-19 09:49:12 +00:00
|
|
|
|
2008-02-28 09:43:59 +00:00
|
|
|
MLI=$(wildcard *.mli)
|
|
|
|
ML=$(wildcard *.ml)
|
2008-02-19 09:49:12 +00:00
|
|
|
|
2008-02-28 09:43:59 +00:00
|
|
|
CMI=$(patsubst %.mli,%.cmi,$(MLI))
|
|
|
|
CMO=$(patsubst %.ml,%.cmo,$(ML))
|
|
|
|
CMX=$(patsubst %.ml,%.cmx,$(ML))
|
2008-02-19 09:49:12 +00:00
|
|
|
|
|
|
|
OCAMLDEP=ocamldep
|
|
|
|
OCAMLOPT=ocamlopt
|
|
|
|
OCAMLC=ocamlc
|
|
|
|
|
2008-02-28 09:43:59 +00:00
|
|
|
INCS=-I +sdl
|
|
|
|
LIBS=-ccopt -L+sdl
|
|
|
|
OPTS=-w A -g -thread $(INCS) $(LIBS)
|
2008-02-19 09:49:12 +00:00
|
|
|
|
|
|
|
define PROGRAM_template
|
2008-02-19 13:25:52 +00:00
|
|
|
ALL_OBJS += $($(1)_OBJS)
|
|
|
|
$(1): $$($(1)_OBJS:=.cmx)
|
2008-02-19 09:49:12 +00:00
|
|
|
@echo -n -e "\x1B[31;1m"
|
2008-02-19 13:25:52 +00:00
|
|
|
@echo "[L] $(1)"
|
2008-02-19 09:49:12 +00:00
|
|
|
@echo -n -e "\x1B[0m"
|
2008-02-19 13:25:52 +00:00
|
|
|
$(OCAMLOPT) $(OPTS) $($(1)_LIBS:=.cmxa) $($(1)_OBJS:=.cmx) -o $(1)
|
2008-02-19 09:49:12 +00:00
|
|
|
@echo ""
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(PROGRAMS)
|
|
|
|
|
2008-03-03 18:14:42 +00:00
|
|
|
doc: $(ML) $(MLI)
|
2008-02-28 09:43:59 +00:00
|
|
|
ocamldoc $(INCS) -d doc -html $(ML) $(MLI)
|
|
|
|
|
2008-02-19 09:49:12 +00:00
|
|
|
%.cmi: %.mli
|
|
|
|
@echo -n -e "\x1B[31;1m"
|
|
|
|
@echo "[I] $<"
|
|
|
|
@echo -n -e "\x1B[0m"
|
|
|
|
$(OCAMLOPT) $(OPTS) -i $<
|
|
|
|
$(OCAMLOPT) $(OPTS) -c $<
|
|
|
|
@echo ""
|
|
|
|
|
|
|
|
%.cmx: %.ml
|
|
|
|
@echo -n -e "\x1B[31;1m"
|
|
|
|
@echo "[C] $<"
|
|
|
|
@echo -n -e "\x1B[0m"
|
|
|
|
$(OCAMLOPT) $(OPTS) -i $<
|
|
|
|
$(OCAMLOPT) $(OPTS) -c $<
|
|
|
|
@echo ""
|
|
|
|
|
|
|
|
%.cmo %.cmi: %.ml %.cmi %.mli
|
|
|
|
@echo "[O] $<"
|
|
|
|
$(OCAMLC) $(OPTS) -i $<
|
|
|
|
$(OCAMLC) $(OPTS) -c $<
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
%.cmo %.cmi: %.ml
|
|
|
|
@echo -n -e "\x1B[31;1m"
|
|
|
|
@echo "[O] $<"
|
|
|
|
@echo -n -e "\x1B[0m"
|
|
|
|
$(OCAMLC) $(OPTS) -i $<
|
|
|
|
$(OCAMLC) $(OPTS) -c $<
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(PROGRAMS) *~ *.cm* *.o *.a *.so .depend *.cmxa *.cma
|
|
|
|
|
2008-02-28 09:43:59 +00:00
|
|
|
.depend: $(ML) $(MLI)
|
|
|
|
$(OCAMLDEP) $(ML) $(MLI) > .depend
|
2008-02-19 09:49:12 +00:00
|
|
|
@echo ""
|
|
|
|
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
-include .depend
|
|
|
|
|