-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 957 Bytes
/
Makefile
File metadata and controls
37 lines (29 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Makefile for verilogtree project, reference: https://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
IDIR=src/include
SRC=src/*.cc
CC=g++
CFLAGS=-I$(IDIR)
# $(IDIR)
DEPS = src/include/*.h
#src/include/deriveHierarchyTree.h src/include/parseUserArgs.h
ODIR=src/obj/
OBJ = src/obj/main.o src/obj/deriveHierarchyTree.o src/obj/parseUserArgs.o
# TODO:
# would be nice to make the above line use *.o instead of having to manually
# list the object files individually
all: create-dir verilogtree
# delete all object files and compile from nothing
rebuild: clean all
# create the object file directory
create-dir:
@mkdir -p src/obj
# compile (but don't link) each changed C++ file
$(ODIR)%.o: src/%.cc $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
# link all the object files
verilogtree: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS)
@cp verilogtree ./tests
.PHONY: clean
clean:
rm -rf $(ODIR)*.o verilogtree tests/verilogtree