1# *****************************************************************************
2# * Copyright (c) 2004, 2008 IBM Corporation
3# * All rights reserved.
4# * This program and the accompanying materials
5# * are made available under the terms of the BSD License
6# * which accompanies this distribution, and is available at
7# * http://www.opensource.org/licenses/bsd-license.php
8# *
9# * Contributors:
10# *     IBM Corporation - initial implementation
11# ****************************************************************************/
12
13# FIXME review -I ...
14# export NEW_BUILD=1
15
16TOPCMNDIR	?= ../..
17INCLCMNDIR	?= ../../include
18
19include $(TOPCMNDIR)/make.rules
20
21
22CPPFLAGS = -I$(INCLCMNDIR) -I$(INCLBRDDIR) -I.
23CFLAGS += $(FLAG)
24
25SRCS = build_ffs.c cfg_parse.c create_flash.c create_crc.c crclib.c
26OBJS = $(SRCS:%.c=%.o)
27
28all: build_romfs
29
30build_romfs: $(OBJS)
31	$(HOSTCC) $(HOSTCFLAGS) $(FLAG) -o $@ $^
32
33testing: build_romfs
34	$(MAKE) -C test
35
36%.o: %.c
37	$(HOSTCC) $(CPPFLAGS) $(HOSTCFLAGS) $(FLAG) -c $< -o $@
38
39clean:
40	rm -f build_romfs *.o
41
42distclean: clean
43	rm -f Makefile.dep
44
45
46# Rules for creating the dependency file:
47depend:
48	rm -f Makefile.dep
49	$(MAKE) Makefile.dep
50
51Makefile.dep: Makefile
52	$(HOSTCC) -MM $(CPPFLAGS) $(HOSTCFLAGS) $(SRCS) > Makefile.dep
53
54# Include dependency file if available:
55-include Makefile.dep
56