improve example makefile
This commit is contained in:
parent
c1d26dc69c
commit
e1ea3c764f
1 changed files with 4 additions and 2 deletions
|
@ -11,8 +11,7 @@ NAMES = $(OBJ:$(EXAMPLE_DIR)/%=%)
|
|||
|
||||
all:
|
||||
ifdef EXAMPLE
|
||||
$(MAKE) -f $(EXAMPLE_DIR)/Makefile $(BIN)/$(EXAMPLE_DIR)/$(EXAMPLE)
|
||||
$(BIN)/$(EXAMPLE_DIR)/$(EXAMPLE)
|
||||
$(MAKE) -f $(EXAMPLE_DIR)/Makefile example-$(EXAMPLE)
|
||||
else
|
||||
@echo "you need to pick a test: make example EXAMPLE=<example_name>"
|
||||
@echo -n "available examples:"
|
||||
|
@ -20,6 +19,9 @@ else
|
|||
@echo
|
||||
endif
|
||||
|
||||
example-%: $(BIN)/$(EXAMPLE_DIR)/%
|
||||
$(BIN)/$(EXAMPLE_DIR)/$(EXAMPLE)
|
||||
|
||||
$(BIN)/%: %.c
|
||||
@mkdir -p $(@D)
|
||||
$(CC) $< $(LDFLAGS) $(CFLAGS) -o $@
|
||||
|
|
Loading…
Reference in a new issue