Obvious fix.
[AROS.git] / tools / copytoafs / Makefile.afslib
blob5b74a382e09e7c068c02b8a119cd38d455a6ab81
1 include $(TOP)/config/make.cfg
3 SILENT := yes
5 DEBUG_OPTS := -g -DDEBUG=0
7 FILES := \
8         bitmap \
9         cache \
10         checksums \
11         extstrings \
12         filehandles1 \
13         filehandles2 \
14         filehandles3 \
15         hashing \
16         misc \
17         os_unix_support \
18         volumes \
19         validator
21 ifeq ($(AROS_HOST_ARCH),aros)
22 FILES := error $(subst os_unix_support,os_aros_support,$(FILES))
23 endif
25 AFSSRCDIR := $(SRCDIR)/rom/filesys/afs
26 ifneq ($(HOSTGENDIR),)
27 OBJDIR := $(HOSTGENDIR)/tools/host_afs
28 else
29 OBJDIR := ./tools/host_afs
30 endif
31 OBJS   := $(patsubst %, $(OBJDIR)/%.o, $(FILES))
32 DEPS   := $(patsubst %, $(OBJDIR)/%.d, $(FILES))
34 INCLUDES := -I$(AFSSRCDIR) -I$(OBJDIR)
35 HOST_CFLAGS := $(HOST_CFLAGS) $(DEBUG_OPTS) -Wall -Werror-implicit-function-declaration $(INCLUDES) -O2
37 ifeq ($(SILENT),yes)
38         ECHO := true
39 endif
41 .PHONY: all depend clean
43 all: $(OBJDIR) depend $(AFSLIB)
45 $(AFSLIB): $(OBJS)
46         @$(ECHO) "Creating $@..."
47         @$(HOST_AR) $@ $?
48         @$(HOST_RANLIB) $@
50 $(OBJDIR)/config.h: $(OBJDIR) myconf.aros
51         @./myconf.aros $(TOP) >> $@
53 $(OBJDIR)/%.o: $(AFSSRCDIR)/%.c $(OBJDIR)/config.h
54         @$(ECHO) "Compiling $(notdir $@)..."
55         @$(HOST_CC) $(HOST_CFLAGS) -o $@ -c $<
57 $(OBJDIR)/%.d: $(AFSSRCDIR)/%.c $(OBJDIR)/config.h
58         @$(ECHO) "Finding dependencies for $<..."
59         @$(HOST_CC) $(HOST_CFLAGS) -M -MT '$(patsubst %.d,%.o,$@)' $< > $@
61 $(OBJDIR):
62         @$(MKDIR) $(OBJDIR)
64 clean:
65         @$(RM) -f $(AFSLIB) $(OBJDIR)
67 depend: $(DEPS)
69 -include $(DEPS)