rockbox/utils/hwstub/tools/Makefile
Amaury Pouly c5357940ab hwstub: major improvement in the stub and the tools
Fix the stub in many way to correctly detect the STMP family and
act upon that. Drop some unused commands and bump version.
Rewrite the tool to allows scripting in lua and load the register
description from an XML file using the regtools. Introduce a new
tool to load and run code using the hwstub (either binary format
or Rockbox additive scramble format). Also switch to an optimise
version of the memcpy/move/set functions to correctly handle
alignement issue (like writing a full word/half-word when
possible for registers which is crucial)

Change-Id: Id1d5cfe0b1b47e8b43900d32c5cd6eafae6414f6
2013-06-13 02:25:15 +02:00

38 lines
1 KiB
Makefile

CC=gcc
CXX=g++
LD=g++
HWSTUB_LIB_DIR=../lib
REGTOOLS_LIB_DIR=../../regtools/lib
CFLAGS=-Wall -O2 `pkg-config --cflags libusb-1.0` -std=c99 -g -I$(HWSTUB_LIB_DIR) -I$(REGTOOLS_LIB_DIR) `pkg-config --cflags lua5.2`
CXXFLAGS=-Wall -O2 `pkg-config --cflags libusb-1.0` -g -I$(HWSTUB_LIB_DIR) -I$(REGTOOLS_LIB_DIR) `pkg-config --cflags lua5.2`
LDFLAGS=`pkg-config --libs libusb-1.0` `pkg-config --libs lua5.2` -lreadline -L$(HWSTUB_LIB_DIR) -L$(REGTOOLS_LIB_DIR) -lsocdesc -lhwstub `xml2-config --libs`
EXEC=hwstub_shell hwstub_load
SRC=$(wildcard *.c)
SRCXX=$(wildcard *.cpp)
OBJ=$(SRC:.c=.o) $(SRCXX:.cpp=.o)
LIBS=$(HWSTUB_LIB_DIR)/libhwstub.a $(REGTOOLS_LIB_DIR)/libsocdesc.a
all: $(EXEC)
$(HWSTUB_LIB_DIR)/libhwstub.a:
make -C $(HWSTUB_LIB_DIR)
$(REGTOOLS_LIB_DIR)/libsocdesc.a:
make -C $(REGTOOLS_LIB_DIR)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
hwstub_shell: hwstub_shell.o $(LIBS)
$(LD) -o $@ $^ $(LDFLAGS)
hwstub_load: hwstub_load.o $(LIBS)
$(LD) -o $@ $^ $(LDFLAGS)
clean:
rm -rf $(OBJ) $(LIB) $(EXEC)