Commit 02f2477f authored by Lucas Russo's avatar Lucas Russo

Makefile: add revision and kernel targets

Now, the revision file gets compiled with everything
else and the PCIe kernel driver also gets installed prior
to compiling the HAL layer
parent 8b760801
...@@ -70,29 +70,28 @@ OUT = $(hal_OUT) ...@@ -70,29 +70,28 @@ OUT = $(hal_OUT)
.SECONDEXPANSION: .SECONDEXPANSION:
# Save a git repository description # Save a git repository description
#REVISION = $(shell git describe --dirty --always) REVISION = $(shell git describe --dirty --always)
#REVISION_NAME = revision REVISION_NAME = revision
#OBJ_REVISION = $(addsuffix .o, $(REVISION_NAME)) OBJ_REVISION = $(addsuffix .o, $(REVISION_NAME))
OBJS_all = $(hal_OBJS) $(OBJ_REVISION) OBJS_all = $(hal_OBJS) $(OBJ_REVISION)
.PHONY: all kernel_check clean mrproper install uninstall tests examples .PHONY: all kernel_install kernel_check \
clean mrproper install uninstall \
tests examples
# Avoid deletion of intermediate files, such as objects # Avoid deletion of intermediate files, such as objects
.SECONDARY: $(OBJS_all) .SECONDARY: $(OBJS_all)
# Makefile rules # Makefile rules
all: kernel_check $(OUT) all: kernel_install $(OUT)
# Output Rule # Output Rule
$(OUT): $$($$@_OBJS) $(OUT): $$($$@_OBJS) $(REVISION_NAME).o
#$(REVISION_NAME).o
$(CC) $(LFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -o $@ $^ $(LDFLAGS) $(LIBS) $(CC) $(LFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -o $@ $^ $(LDFLAGS) $(LIBS)
#$(SIZE) $@
#$(REVISION_NAME).o: $(REVISION_NAME).c $(REVISION_NAME).o: $(REVISION_NAME).c
# $(CC) $(CFLAGS) $(INCLUDE_DIRS) -DGIT_REVISION=\"$(REVISION)\" -c $< $(CC) $(CFLAGS) $(INCLUDE_DIRS) -DGIT_REVISION=\"$(REVISION)\" -c $<
# $(SIZE) -t $@
# Pull in dependency info for *existing* .o files and don't complain if the # Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found # corresponding .d file is not found
...@@ -125,8 +124,10 @@ $(OUT): $$($$@_OBJS) ...@@ -125,8 +124,10 @@ $(OUT): $$($$@_OBJS)
@rm -f $*.d.tmp @rm -f $*.d.tmp
kernel_check: kernel_check:
# Check for libraries and issue warning!!! $(MAKE) -C $(KERNEL_DIR) all
# $(MAKE) -C $(KERNEL_DIR) all
kernel_install: kernel_check
$(MAKE) -C $(KERNEL_DIR) install
tests: tests:
$(MAKE) -C $@ all $(MAKE) -C $@ all
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment