diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Real-Time Systems/Praktikum1/Aufgabe3/Makefile | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Master/Real-Time Systems/Praktikum1/Aufgabe3/Makefile')
| -rw-r--r-- | Master/Real-Time Systems/Praktikum1/Aufgabe3/Makefile | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Master/Real-Time Systems/Praktikum1/Aufgabe3/Makefile b/Master/Real-Time Systems/Praktikum1/Aufgabe3/Makefile new file mode 100644 index 0000000..648c711 --- /dev/null +++ b/Master/Real-Time Systems/Praktikum1/Aufgabe3/Makefile @@ -0,0 +1,49 @@ +# +# Variables +# +PROJECT_ROOT = . +BUILDDIR = $(PROJECT_ROOT)/build +SOURCEDIR = $(PROJECT_ROOT)/src +INCLUDEDIRS = $(SOURCEDIR) +INCLUDES = $(addprefix -I,$(INCLUDEDIRS)) +LIBNAMES = +LIBS = $(addprefix -l,$(LIBNAMES)) +DEBUGFLAGS = -g +CFLAGS = -Wall -DDEBUG_MODE -DDEBUG +CFLAGS += -DLINUX $(DEBUGFLAGS) +LDFLAGS = $(DEBUGFLAGS) +CC = g++ +LD = g++ + +LINK_TARGET = $(BUILDDIR)/scheduler_sim + +SOURCES := $(wildcard $(SOURCEDIR)/*.cpp) + +OBJS_TMP := $(foreach srcfile,$(SOURCES),$(srcfile).o) +OBJS := $(foreach tmp,$(OBJS_TMP),$(patsubst $(SOURCEDIR)/%.cpp.o,$(BUILDDIR)/%.o,$(tmp))) + +REBUILDABLES = $(OBJS) $(LINK_TARGET) + +.PHONY: clean +clean : + rm -f $(REBUILDABLES) + rm -f $(BUILDDIR)/* + rmdir $(BUILDDIR) + @echo Clean done + +all : builddir $(LINK_TARGET) + @echo All done + +builddir : + @echo 'Creating build directory' + mkdir -p $(BUILDDIR) + +$(LINK_TARGET) : $(OBJS) + @echo 'Linking file: $@' + $(LD) $(LDFLAGS) $(LIBS) -o $@ $^ + +$(BUILDDIR)/%.o : $(SOURCEDIR)/%.cpp + @echo 'Building file: $<' + $(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $< + + |
