2009-04-04 20:24:21 +02:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
obj ?= $(shell pwd)
|
|
|
|
|
2009-04-20 23:38:11 +02:00
|
|
|
COMMANDS=create.o bootblock.o delete.o extract.o add.o print.o resize.o
|
2009-04-14 02:08:34 +02:00
|
|
|
OBJ=$(COMMANDS) cbfstool.o util.o fs.o
|
|
|
|
INC=cbfstool.h cbfs.h
|
2009-04-04 20:24:21 +02:00
|
|
|
|
|
|
|
CC=gcc
|
2009-05-08 21:39:15 +02:00
|
|
|
CFLAGS=-g -Wall -W -Werror
|
2009-04-04 20:24:21 +02:00
|
|
|
|
|
|
|
DESTDIR ?= /usr/local/bin
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-14 21:48:32 +02:00
|
|
|
all: $(obj)/cbfstool $(obj)/tools/cbfs-mkpayload $(obj)/tools/cbfs-mkstage
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-14 02:08:34 +02:00
|
|
|
$(obj)/cbfstool: $(patsubst %,$(obj)/%,$(OBJ))
|
2009-04-04 20:24:21 +02:00
|
|
|
$(CC) -o $@ $(patsubst %,$(obj)/%,$(OBJ))
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-05 00:18:26 +02:00
|
|
|
tobj = $(obj)/tools
|
|
|
|
tsrc = $(shell pwd)/tools
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-05 00:55:49 +02:00
|
|
|
include $(tsrc)/Makefile
|
2009-04-05 00:18:26 +02:00
|
|
|
|
|
|
|
$(obj)/%.o: %.c $(INC)
|
2009-04-04 20:24:21 +02:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-14 21:48:32 +02:00
|
|
|
install: $(obj)/cbfstool $(obj)/tools/cbfs-mkpayload $(obj)/tools/cbfs-mkstage
|
2009-03-31 13:57:36 +02:00
|
|
|
@ install -d $(DESTDIR)
|
2009-04-14 02:08:34 +02:00
|
|
|
@ install -m 0755 $(obj)/cbfstool $(DESTDIR)/cbfstool
|
2009-04-14 21:48:32 +02:00
|
|
|
@ install -m 0755 $(obj)/tools/cbfs-mkstage $(DESTDIR)/cbfs-mkstage
|
|
|
|
@ install -m 0755 $(obj)/tools/cbfs-mkpayload $(DESTDIR)/cbfs-mkpayload
|
2009-03-31 13:57:36 +02:00
|
|
|
|
|
|
|
tags:
|
|
|
|
ctags *.[ch] */*.[ch]
|
2009-04-04 20:24:21 +02:00
|
|
|
|
2009-04-05 00:18:26 +02:00
|
|
|
clean: tools-clean
|
2009-04-14 02:08:34 +02:00
|
|
|
rm -f $(patsubst %,$(obj)/%,$(OBJ)) $(obj)/cbfstool
|
2009-04-05 00:18:26 +02:00
|
|
|
|