2 include $(TOP)/config/make.cfg
4 # a make.tmpl for a hiddclass would be useful
6 CFLAGS := $(CFLAGS) -DAROS_USE_OOP -I.
8 OBJDIR := $(GENDIR)/$(CURDIR)
9 #OS_INCLUDES := -I$(GENINCDIR)
11 # Sigh, this is needed because libtail.c uses <libdefs.h> not "libdefs.h"
14 # will be expand to LIBNAME.LIBPOST i.e. graphics.hidd
15 LIBNAME := graphics_amiga_intui
16 ULIBNAME := Graphics_amiga_intui
19 FILES := GraphicsClass BM_Class functable
21 INIT_FILE := $(LIBNAME)_init
22 END_FILE := $(LIBNAME)_end
24 MY_INCLS := $(wildcard include/*.h)
25 DEST_INC := $(foreach f,$(MY_INCLS), $(AROS_INCLUDES)/hidd/$(notdir $f))
26 GEN_INC := $(foreach f,$(MY_INCLS), $(GENINCDIR)/hidd/$(notdir $f))
28 ifeq ($(FLAVOUR),native)
29 DEPLIBS := arossupport arosc
34 # Replacement is probably of limited use in this directory, but I'll
35 # support it nonetheless.
37 %prepare_replace rom/hidd
38 %filter_replace var=FILES
40 %prepare_shlib lib=hiddgfxaicl shflag=$(SHARED_HIDDCLASS)
43 INITFUNC := $(OBJDIR)/$(INIT_FILE).o
46 ENDFUNC := $(OBJDIR)/$(END_FILE).o
49 OSMODULE := $(LIBNAME).$(LIBPOST)
52 OBJS := $(foreach f,$(FILES) $(ADDITIONAL_OBJS),$(OBJDIR)/$(f).o)
53 ALL_OBJS := $(OBJS) $(ENDFUNC)
55 $(AROS_DRIVERS)/$(OSMODULE) : $(LIB) $(INITFUNC) \
56 $(foreach f,$(DEPLIBS), $(LIBDIR)/lib$(f).a)
57 @echo "Building $(notdir $@) ..."
58 @$(CC) $(ILDFLAGS) $(GENMAP) $(OSMODULE).map -L$(LIBDIR) \
59 $(INITFUNC) $(LIB) $(foreach f, $(DEPLIBS), -l$(f)) \
60 -o $@ 2>&1 | tee $(OSMODULE).err
61 @if $(TEST) ! -s $(OSMODULE).err; then rm $(OSMODULE).err ; else true; fi
62 ifeq ($(FLAVOUR),native)
68 #MM hidd-graphics-amiga-intui-linklib : includes
69 hidd-graphics-amiga-intui-linklib : show-flags $(LIB)
72 #MM hidd-graphics-amiga-intui-module : includes
73 hidd-graphics-amiga-intui-module : show-flags $(LIB) $(AROS_DRIVERS)/$(OSMODULE)
75 # --- QUICK HACKS BEGIN ---
76 # These are hacks for faster execution of "mmake" and "make". Use them
77 # only if you know set the setup is correct and do not add them as targets
81 # mmake AROS.hidd-graphics-quick
82 # make -f TOP=/dh1/AROS CURDIR=workbench/hidds/graphics mmakefile hidd-graphics-quick
84 #MM hidd-graphics-amiga-intui-module-quick :
85 hidd-graphics-amiga-intui-module-quick : show-flags $(LIB) $(AROS_DRIVERS)/$(OSMODULE)
88 #MM hidd-graphics-amiga-intui-includes-quick
89 hidd-graphics-amiga-intui-includes-quick : setup-includes includes-copy
92 # --- QUICK HACKS END ---
94 DEPS := $(foreach f, $(INIT_FILE) $(FILES) $(END_FILE), $(OBJDIR)/$(f).d)
96 $(LIB): libdefs.h $(ALL_OBJS)
97 %mklib_q from=$(ALL_OBJS)
101 includes-copy : $(DEST_INC) $(GEN_INC)
104 $(AROS_INCLUDES)/hidd/%.h : include/%.h
105 $(CP) include/$(notdir $<) $@
107 $(GENINCDIR)/hidd/%.h : include/%.h
108 $(CP) include/$(notdir $<) $@
112 %mkdirs_q $(GENINCDIR) $(AROS_INCLUDES) $(GENINCDIR)/hidd $(AROS_INCLUDES)/hidd
114 # Rule to create a .library in the local dir
115 libdefs.h : lib.conf $(BINDIR)/scripts/genlibdefs.awk
116 @$(ECHO) "Generating $@..."
117 @$(AWK) -f $(BINDIR)/scripts/genlibdefs.awk $< > $@
120 @$(ECHO) "Generating $@..."
121 @$(ECHO) "#include <libcore/libtail.c>" > $@
127 -$(RM) $(OBJDIR) *.err $(LIB) *.s
132 %asm_rule opt="$(FILES) $(INIT_FILE) $(END_FILE)"
136 %additional_objs_rule
142 @$(ECHO) "CFLAGS=$(CFLAGS)"