50 lines
1010 B
Makefile
50 lines
1010 B
Makefile
LIBNAME = usbstack
|
|
|
|
# Package definitions
|
|
PKG_NAME = target
|
|
DATE = $$(date +%Y%m%d)
|
|
|
|
# Tool definitions
|
|
CC = arm-none-eabi-gcc
|
|
LD = arm-none-eabi-ld -v
|
|
AR = arm-none-eabi-ar
|
|
AS = arm-none-eabi-as
|
|
CP = arm-none-eabi-objcopy
|
|
OD = arm-none-eabi-objdump
|
|
RM = rm
|
|
TAR = tar
|
|
|
|
CFLAGS = -I./ -I../ -c -W -Wall -Os -g -DDEBUG -mcpu=arm7tdmi
|
|
ARFLAGS = -rcs
|
|
|
|
LIBSRCS = usbhw_lpc.c usbcontrol.c usbstdreq.c usbinit.c
|
|
LIBOBJS = $(LIBSRCS:.c=.o)
|
|
|
|
all: depend lib
|
|
|
|
clean:
|
|
$(RM) -f $(LIBNAME).a $(LIBOBJS) .depend
|
|
make -C clean
|
|
|
|
# build lib
|
|
lib: $(LIBNAME).a
|
|
|
|
$(LIBNAME).a: $(LIBOBJS)
|
|
$(AR) $(ARFLAGS) $@ $^
|
|
|
|
# Builds release tar file
|
|
dist: clean
|
|
cd .. && $(TAR) --exclude={CVS,cvs,.svn} -cvzf $(PKG_NAME)-$(DATE).tar.gz $(PKG_NAME)
|
|
|
|
# recompile if the Makefile changes
|
|
$(LIBOBJS): Makefile
|
|
|
|
# dependency checking
|
|
depend: $(LIBSRCS)
|
|
$(CC) $(CFLAGS) -MM $^ > .depend || rm -f .depend
|
|
|
|
# phony targets
|
|
.PHONY: all clean depend
|
|
|
|
-include .depend
|