2012-11-14 11:51:51 +00:00
|
|
|
CC=gcc
|
2013-06-13 00:02:53 +00:00
|
|
|
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
|
2012-11-14 11:51:51 +00:00
|
|
|
SRC=$(wildcard *.c)
|
2013-06-13 00:02:53 +00:00
|
|
|
SRCXX=$(wildcard *.cpp)
|
|
|
|
OBJ=$(SRC:.c=.o) $(SRCXX:.cpp=.o)
|
|
|
|
LIBS=$(HWSTUB_LIB_DIR)/libhwstub.a $(REGTOOLS_LIB_DIR)/libsocdesc.a
|
2012-11-14 11:51:51 +00:00
|
|
|
|
|
|
|
all: $(EXEC)
|
|
|
|
|
2013-06-13 00:02:53 +00:00
|
|
|
$(HWSTUB_LIB_DIR)/libhwstub.a:
|
|
|
|
make -C $(HWSTUB_LIB_DIR)
|
|
|
|
|
|
|
|
$(REGTOOLS_LIB_DIR)/libsocdesc.a:
|
|
|
|
make -C $(REGTOOLS_LIB_DIR)
|
|
|
|
|
2012-11-14 11:51:51 +00:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
2013-06-13 00:02:53 +00:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
hwstub_shell: hwstub_shell.o $(LIBS)
|
|
|
|
$(LD) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
hwstub_load: hwstub_load.o $(LIBS)
|
|
|
|
$(LD) -o $@ $^ $(LDFLAGS)
|
2012-11-14 11:51:51 +00:00
|
|
|
|
|
|
|
clean:
|
2013-06-13 00:02:53 +00:00
|
|
|
rm -rf $(OBJ) $(LIB) $(EXEC)
|
2012-11-14 11:51:51 +00:00
|
|
|
|
|
|
|
|