Makefile 765 B

123456789101112131415161718192021222324252627282930313233
  1. all: lpc21isp
  2. GLOBAL_DEP = adprog.h lpc21isp.h lpcprog.h lpcterm.h
  3. CC = gcc
  4. ifneq ($(findstring(freebsd, $(OSTYPE))),)
  5. CFLAGS+=-D__FREEBSD__
  6. endif
  7. ifeq ($(OSTYPE),)
  8. OSTYPE = $(shell uname)
  9. endif
  10. ifneq ($(findstring Darwin,$(OSTYPE)),)
  11. CFLAGS+=-D__APPLE__
  12. endif
  13. CFLAGS += -Wall -static
  14. adprog.o: adprog.c $(GLOBAL_DEP)
  15. $(CC) $(CDEBUG) $(CFLAGS) -c -o adprog.o adprog.c
  16. lpcprog.o: lpcprog.c $(GLOBAL_DEP)
  17. $(CC) $(CDEBUG) $(CFLAGS) -c -o lpcprog.o lpcprog.c
  18. lpcterm.o: lpcterm.c $(GLOBAL_DEP)
  19. $(CC) $(CDEBUG) $(CFLAGS) -c -o lpcterm.o lpcterm.c
  20. lpc21isp: lpc21isp.c adprog.o lpcprog.o lpcterm.o $(GLOBAL_DEP)
  21. $(CC) $(CDEBUG) $(CFLAGS) -o lpc21isp.out lpc21isp.c adprog.o lpcprog.o lpcterm.o
  22. clean:
  23. $(RM) adprog.o lpcprog.o lpcterm.o lpc21isp.out