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
|
2009-04-05 00:18:26 +02:00
|
|
|
INC=romtool.h romfs.h
|
2009-04-04 20:24:21 +02:00
|
|
|
|
|
|
|
CC=gcc
|
2009-04-05 00:18:26 +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-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-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-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-04-05 00:18:26 +02:00
|
|
|
clean: tools-clean
|
2009-04-04 20:24:21 +02:00
|
|
|
rm -f $(patsubst %,$(obj)/%,$(OBJ)) $(obj)/romtool
|
2009-04-05 00:18:26 +02:00
|
|
|
|