diff options
| author | zy <[email protected]> | 2023-11-22 21:14:15 -0500 |
|---|---|---|
| committer | zy <[email protected]> | 2023-11-22 21:14:15 -0500 |
| commit | 0ae425d99e2df24d014987e035ac3041fec444b1 (patch) | |
| tree | fc71b64ef2a4b0f0d7b2a382b6355edebea486f3 /Makefile | |
| parent | 9cd12a063a48be55c63fe5cabc6e7593fd7f39b0 (diff) | |
print_trace
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -4,6 +4,7 @@ CFLAGS = -Wall PROG = helloworld HPTEST = hptest USTACK = userstack +SPID = stack-pid UDIR = $(PWD)/source/uapi MDIR := $(PWD)/source @@ -18,7 +19,7 @@ OUTPUT_DIR = $(PWD)/build # obj-m := kernel/$(KMOD).o # $(KMOD)-objs := kernel/monitor_kernel.o -all: $(PROG) $(HPTEST) $(USTACK) module +all: $(PROG) $(HPTEST) $(USTACK) $(SPID) module $(PROG): $(TDIR)/helloworld.c mkdir -p $(OUTPUT_DIR) @@ -30,7 +31,11 @@ $(HPTEST): $(TDIR)/hptest.c $(USTACK): $(TDIR)/userstack.c mkdir -p $(OUTPUT_DIR) - $(CC) $(CFLAGS) -o $(OUTPUT_DIR)/$(USTACK) $(TDIR)/userstack.c + $(CC) -g $(CFLAGS) -o $(OUTPUT_DIR)/$(USTACK) $(TDIR)/userstack.c -lunwind -lunwind-x86_64 + +$(SPID): $(TDIR)/stack-pid.c + mkdir -p $(OUTPUT_DIR) + $(CC) $(CFLAGS) -o $(OUTPUT_DIR)/$(SPID) $(TDIR)/stack-pid.c -lunwind -lunwind-x86_64 -lunwind-ptrace module: make -C $(KDIR) M=$(MDIR) modules |
