CC = gcc
INCLUDES =
CFLAGS = -Wall -O2 -g $(INCLUDES)
LIBS = -lusb
LDFLAGS = -g $(LIBS)
APP_NAME = tt-loader
APP_VERSION = 0.1

OBJS = main.o

all: $(APP_NAME)

$(APP_NAME): $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $^

clean:
	rm -rf $(APP_NAME) *.o *~
	$(MAKE) -C 2nd clean

2nd:
	$(MAKE) -C 2nd all

pkg: 2nd
	rm -f $(APP_NAME)-$(APP_VERSION).tar.gz
	tar czf $(APP_NAME)-$(APP_VERSION).tar.gz Makefile *.c COPYING README commands.txt \
		tt-loader.sh 2nd/arm.ld 2nd/*.h 2nd/*.c 2nd/Makefile 2nd/start.S 2nd/2nd.bin

.PHONY: all clean 2nd
