config/make.tmpl: pass -nix flag also to LDFLAGS of configure
[AROS.git] / tools / copytoafs / Makefile
blobb771e163dadc96a441d42113e23d70fe31a61f02
1 include $(TOP)/config/make.cfg
3 SILENT := yes
5 DEBUG_OPTS := -g -DDEBUG=0
7 FILES := copytoafs
9 ifeq ($(AROS_HOST_ARCH),mingw32)
10 LIBS := -lws2_32
11 endif
13 AFSSRCDIR := $(SRCDIR)/rom/filesys/afs
14 ifneq ($(HOSTGENDIR),)
15 OBJDIR := $(HOSTGENDIR)/tools/host_copytoafs
16 else
17 OBJDIR := ./tools/host_copytoafs
18 endif
19 OBJS := $(patsubst %, $(OBJDIR)/%.o, $(FILES))
20 DEPS := $(patsubst %, $(OBJDIR)/%.d, $(FILES))
22 INCLUDES := -I$(AFSSRCDIR) -I$(OBJDIR)
23 HOST_CFLAGS := $(HOST_CFLAGS) $(DEBUG_OPTS) -Wall -Werror-implicit-function-declaration $(INCLUDES) -O2
25 ifeq ($(SILENT),yes)
26 ECHO := true
27 endif
29 .PHONY: all depend clean
31 all: depend $(OBJDIR) $(COPYTOAFS)
33 $(COPYTOAFS): $(OBJS)
34 @$(ECHO) "Linking $@..."
35 $(HOST_CC) $(OBJS) $(AFSLIB) -o $@ $(LIBS)
37 $(OBJDIR)/config.h: $(OBJDIR) myconf.aros
38 @./myconf.aros $(TOP) >> $@
40 $(OBJDIR)/%.o: %.c $(OBJDIR)/config.h
41 @$(ECHO) "Compiling $(notdir $@)..."
42 @$(HOST_CC) $(HOST_CFLAGS) -o $@ -c $<
44 $(OBJDIR)/%.d: %.c $(OBJDIR)/config.h
45 @$(ECHO) "Finding dependencies for $<..."
46 @$(HOST_CC) $(HOST_CFLAGS) -M -MT '$(patsubst %.d,%.o,$@)' $< > $@
48 $(OBJDIR):
49 @$(MKDIR) $(OBJDIR)
51 clean:
52 @$(RM) -f $(COPYTOAFS) $(OBJDIR)
54 depend: $(DEPS)
56 -include $(DEPS)