Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1.  
  2. # Directories
  3.  
  4. INCDIR = inc
  5. OBJDIR = obj
  6. LIBDIR = lib
  7. SRCDIR = src
  8.  
  9. # Compiler defs
  10.  
  11. CC=gcc
  12. CFLAGS=-I$(INCDIR) -L$(LIBDIR) $(LIBS)
  13. # LIBS=-lm # Uncomment if <math.h> used
  14.  
  15. # List common header files here
  16.  
  17. _DEPS = errors.h radio.h alarm.h simsec.h
  18. DEPS = $(patsubst %,$(INCDIR)/%,$(_DEPS))
  19.  
  20. # List implementation object files here
  21.  
  22. # For radio layer
  23. _RAD_OBJS = radio.o
  24. RAD_OBJS = $(patsubst %,$(OBJDIR)/%,$(_RAD_OBJS))
  25.  
  26. # For SimSec protocol layer
  27. _SIMSEC_OBJS = simsec.o alarm.o
  28. SIMSEC_OBJS = $(patsubst %,$(OBJDIR)/%,$(_SIMSEC_OBJS)) $(RAD_OBJS)
  29.  
  30. # Rules
  31.  
  32. $(OBJDIR)/%.o: $(SRCDIR)/%.c $(DEPS)
  33. $(CC) -c -o $@ $< $(CFLAGS)
  34.  
  35. # Targets
  36.  
  37. all: radio_test simtec_test
  38.  
  39. radio_test: $(OBJDIR)/radio_test.o $(RAD_OBJS)
  40. gcc -o $@ $^ $(CFLAGS) $(LIBS)
  41.  
  42. simsec_test: $(OBJDIR)/simsec_test.o $(SIMSEC_OBJS)
  43. gcc -o $@ $^ $(CFLAGS) $(LIBS)
  44.  
  45.  
  46. .PHONY: clean clean-targets
  47.  
  48. clean:
  49. rm -f $(OBJDIR)/*.o $(SRCDIR)/*~ core $(INCDIR)/*~ *~
  50.  
  51. clean-targets:
  52. rm -f radio_test simsec_test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement