2009-04-04 20:24:21 +02:00
|
|
|
#
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
obj ?= $(shell pwd)
|
|
|
|
|
2009-03-31 13:57:36 +02:00
|
|
|
COMMANDS=create.o bootblock.o delete.o add.o print.o resize.o
|
2009-04-04 20:24:21 +02:00
|
|
|
OBJ=$(COMMANDS) romtool.o util.o fs.o
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
CFLAGS=-g -Wall -W #-Werror
|
|
|
|
|
2009-03-31 13:57:36 +02:00
|
|
|
H=romtool.h
|
2009-04-04 20:24:21 +02:00
|
|
|
DESTDIR ?= /usr/local/bin
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-04 20:24:21 +02:00
|
|
|
all: $(obj)/romtool $(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-04 20:24:21 +02:00
|
|
|
$(obj)/romtool: $(patsubst %,$(obj)/%,$(OBJ))
|
|
|
|
$(CC) -o $@ $(patsubst %,$(obj)/%,$(OBJ))
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-04 20:24:21 +02:00
|
|
|
$(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage:
|
|
|
|
$(MAKE) -C tools/ obj=$(obj)/tools $(patsubst tools/%, %, $@)
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-04 20:24:21 +02:00
|
|
|
$(obj)/%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2009-04-04 20:24:21 +02:00
|
|
|
install: $(obj)/romtool $(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage
|
2009-03-31 13:57:36 +02:00
|
|
|
@ install -d $(DESTDIR)
|
2009-04-04 20:24:21 +02:00
|
|
|
@ install -m 0755 $(obj)/romtool $(DESTDIR)/romtool
|
|
|
|
@ install -m 0755 $(obj)/tools/rom-mkstage $(DESTDIR)/rom-mkstage
|
|
|
|
@ install -m 0755 $(obj)/tools/rom-mkpayload $(DESTDIR)/rom-mkpayload
|
2009-03-31 13:57:36 +02:00
|
|
|
|
|
|
|
tags:
|
|
|
|
ctags *.[ch] */*.[ch]
|
2009-04-04 20:24:21 +02:00
|
|
|
|
2009-03-31 13:57:36 +02:00
|
|
|
clean:
|
2009-04-04 15:05:18 +02:00
|
|
|
$(MAKE) -C tools/ clean
|
2009-04-04 20:24:21 +02:00
|
|
|
rm -f $(patsubst %,$(obj)/%,$(OBJ)) $(obj)/romtool
|