Browse Source

Add lacking .PHONY to Makefiles (#118)

Michał Kowalczyk 6 years ago
parent
commit
3a24ad56d4

+ 3 - 1
LibOS/Makefile

@@ -8,7 +8,7 @@ SHIM_DIR = shim
 BUILD_DIR = glibc-build
 GLIBC_TARGET = $(addprefix $(BUILD_DIR)/,libc.so.6 ld-linux-x86-64.so.2 libpthread.so.0 libm.so.6 libdl.so.2 libutil.so.1 crt1.o crti.o crtn.o liblibos.so.1 libnss_dns.so.2 libresolv.so.2)
 
-
+.PHONY: all
 all: $(GLIBC_TARGET)
 	$(MAKE) -C $(SHIM_DIR) all
 
@@ -42,6 +42,7 @@ pack: $(GLIBC_TARGET)
 	@../Scripts/pack_binaries.sh glibc $^
 	$(MAKE) -C $(SHIM_DIR) pack
 
+.PHONY: clean
 clean:
 	$(MAKE) -C $(SHIM_DIR) clean
 	rm -rf $(BUILD_DIR)
@@ -50,6 +51,7 @@ else
 $(GLIBC_TARGET): .packed/glibc.tar.gz
 	tar -xmozf $< $@
 
+.PHONY: clean
 clean:
 	rm -rf $(BUILD_DIR)
 endif

+ 6 - 2
LibOS/shim/test/Makefile

@@ -20,9 +20,12 @@ CFLAGS-debug = $(CFLAGS) -I$(SHIMDIR)/../include -I$(PALDIR)/../include/pal -I$(
 LDFLAGS	=
 LDFLAGS-debug = $(LDFLAGS) -L$(SHIMDIR) -L$(PALDIR) -Wl,-rpath-link=$(abspath $(RUNTIME))
 
+.PHONY: default
 default: all
+
 include $(PALDIR)/Makefile.Test
 
+.PHONY: all
 all: pal_loader $(target) $(if $(level),,build-subdirs) | $(call expand_target,$(exec_target))
 
 ifeq ($(DEBUG),1)
@@ -64,11 +67,11 @@ manifest: manifest.template
 	@echo [ $@ ]
 	sed $(manifest_rules) $< > $@
 
-.PHONY: test clean
-
+.PHONY: clean
 clean: $(clean-extra) $(if $(level),,clean-subdirs)
 	rm -rf pal_loader $(call expand_target,$(exec_target)) $(target)
 
+.PHONY: build-subdirs
 build-subdirs:
 	for f in $(subdirs); do (cd $$f; $(MAKE); cd ..); done
 
@@ -80,5 +83,6 @@ pack:
 endif
 endif
 
+.PHONY: clean-subdirs
 clean-subdirs:
 	for f in $(subdirs); do (cd $$f; $(MAKE) clean; cd ..); done

+ 4 - 0
LibOS/shim/test/regression/Makefile

@@ -9,7 +9,9 @@ target = $(exec_target) manifest
 
 clean-extra += clean-tmp
 
+.PHONY: default
 default: all
+
 level = ../
 include ../Makefile
 
@@ -48,6 +50,7 @@ ifeq ($(SGX_RUN),1)
 	PYTHONENV += "TIMEOUT=5000"
 endif
 
+.PHONY: regression
 regression: $(target)
 	@echo "\n\nBasic Bootstrapping:"
 	@for f in $(wildcard 00_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
@@ -56,5 +59,6 @@ regression: $(target)
 	@echo "\n\nLarge File Support:"
 	@for f in $(wildcard 90_*.py); do env $(PYTHONENV) python $$f $(RUNTIME)/pal-$(PAL_HOST); done
 
+.PHONY: clean-tmp
 clean-tmp:
 	rm -rf *.tmp ../apps/ltp/*.csv *.cached *.manifest.sgx *~ *.sig *.token

+ 1 - 0
Pal/Makefile

@@ -14,6 +14,7 @@ endif
 
 DIRS = src test regression
 
+.PHONY: all clean
 all clean:
 	for d in $(DIRS); \
 	do \

+ 2 - 0
Pal/ipc/linux/Makefile

@@ -8,12 +8,14 @@ else
 	KERNELDIR ?= /lib/modules/$(shell uname -r)/build
 	PWD := $(shell pwd)
 
+.PHONY: default
 default:
 	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
 
 graphene-ipc.i: graphene-ipc.c
 	$(MAKE) -C $(KERNELDIR) M=$(PWD) $@
 
+.PHONY: clean
 clean:
 	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
 

+ 2 - 0
Pal/lib/Makefile

@@ -48,6 +48,7 @@ objs += crypto/adapters/wolfssl_adapter.o
 objs += crypto/adapters/wolfssl_dh.o
 endif
 
+.PHONY: all
 all: $(target)graphene-lib.a
 
 ifeq ($(DEBUG),1)
@@ -68,5 +69,6 @@ $(target)%.o: %.c $(headers) ../src/host_endian.h
 	@mkdir -p $(dir $@)
 	@$(CC) $(CFLAGS) -c $< -o $@
 
+.PHONY: clean
 clean:
 	rm -f $(objs) graphene-lib.a

+ 3 - 0
Pal/regression/Makefile

@@ -14,6 +14,7 @@ graphene_lib = .lib/graphene-lib.a
 pal_lib = ../src/libpal.so
 headers = $(wildcard ../include/pal/*.h)
 
+.PHONY: default
 default: all
 include ../src/Makefile.Test
 
@@ -22,6 +23,7 @@ RUNTIME_DIR = $(CURDIR)/../../Runtime
 export PAL_LOADER = $(RUNTIME_DIR)/pal-$(PAL_HOST)
 export PAL_SEC = $(RUNTIME_DIR)/pal_sec-$(PAL_HOST)
 
+.PHONY: all
 all: $(call expand_target,$(target)) $(preloads)
 
 ifeq ($(DEBUG),1)
@@ -87,5 +89,6 @@ regression: $(call expand_target,$(target))
 	@for f in $(wildcard 05_*.py); do env $(PYTHONENV) python $$f || exit $?; done
 	@printf "\n\n"
 
+.PHONY: clean
 clean:
 	rm -rf $(call expand_target,$(target)) $(preloads) *.tmp .lib *.cached *.sig

+ 2 - 0
Pal/src/Makefile

@@ -65,6 +65,7 @@ endif
 
 files_to_install = $(runtime_loader) $(runtime_lib) $(runtime_sec) $(runtime_gdb)
 
+.PHONY: all
 all: | check_target $(files_to_build) $(files_to_install)
 
 ifndef SAVED_TARGET
@@ -153,6 +154,7 @@ user_shared_start.o: user_start.S
 	@echo [ $@ ]
 	@$(CC) $(CFLAGS) $(defs) -E $< -o $@ $(CFLAGS-suffix)
 
+.PHONY: clean
 clean:
 ifneq ($(SAVED_OS),$(PAL_HOST))
 	$(MAKE) clean PAL_HOST=$(SAVED_OS)

+ 1 - 0
Pal/src/Makefile.Host

@@ -27,5 +27,6 @@ export PAL_HOST
 export PAL_HOST_MACRO = $(shell echo $(PAL_HOST) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
 
 .DEFAULT_GOAL := all
+.PHONY: print_host
 print_host:
 	@echo $(PAL_HOST)

+ 2 - 0
Pal/src/host/FreeBSD/Makefile

@@ -21,6 +21,7 @@ objs	= $(addprefix db_,files devices pipes sockets streams memory threading \
 graphene_lib = ../../../lib/graphene-lib.a
 headers	= $(wildcard *.h) $(wildcard ../../*.h) $(wildcard ../../../lib/*.h)
 
+.PHONY: all
 all: $(host_target)
 
 ifeq ($(DEBUG),1)
@@ -61,5 +62,6 @@ libpal-FreeBSD.a: $(addsuffix .o,$(objs)) $(graphene_lib)
 	@echo [ host/FreeBSD/$@ ]
 	@$(AS) $(ASFLAGS) $(defs) -E $< -o $@
 
+.PHONY: clean
 clean:
 	rm -f $(addsuffix .o,$(objs)) $(host_target)

+ 2 - 0
Pal/src/host/Linux-SGX/Makefile

@@ -17,6 +17,7 @@ graphene_lib = ../../.lib/graphene-lib.a
 headers	= $(wildcard *.h) $(wildcard ../../*.h) $(wildcard ../../../lib/*.h) \
 	  $(addprefix sgx-driver/,graphene-sgx.h isgx_version.h)
 
+.PHONY: all
 all: $(host_files)
 
 ifeq ($(DEBUG),1)
@@ -68,5 +69,6 @@ debugger/sgx_gdb.so: debugger/sgx_gdb.c debugger/sgx_gdb.h sgx_arch.h
 sgx-driver/isgx_version.h:
 	cd sgx-driver && make isgx_version.h
 
+.PHONY: clean
 clean:
 	rm -f *.o *.e $(host_files)

+ 2 - 0
Pal/src/host/Linux-SGX/sgx-driver/Makefile

@@ -9,6 +9,7 @@ else
 KDIR := /lib/modules/$(shell uname -r)/build
 PWD  := $(shell pwd)
 
+.PHONY: default
 default: isgx_version.h linux-sgx-driver
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) CFLAGS_MODULE="-DDEBUG -g -O0" modules
 
@@ -20,6 +21,7 @@ isgx_version.h linux-sgx-driver: link-sgx-driver
 
 endif
 
+.PHONY: clean
 clean:
 	rm -vrf linux-sgx-driver isgx_version.h
 	rm -vrf *.o *.ko *.order *.symvers *.mod.c .tmp_versions .*o.cmd

+ 2 - 0
Pal/src/host/Linux/Makefile

@@ -18,6 +18,7 @@ objs	= $(addprefix db_,files devices pipes sockets streams memory threading \
 graphene_lib = ../../.lib/graphene-lib.a
 headers	= $(wildcard *.h) $(wildcard ../../*.h) $(wildcard ../../../lib/*.h)
 
+.PHONY: all
 all: $(host_files)
 
 ifeq ($(DEBUG),1)
@@ -54,5 +55,6 @@ libpal-Linux.a: $(addsuffix .o,$(objs)) $(graphene_lib)
 	@echo [ host/Linux/$@ ]
 	@$(AS) $(ASFLAGS) $(defs) -E $< -o $@
 
+.PHONY: clean
 clean:
 	rm -f $(addsuffix .o,$(objs)) $(host_files)

+ 2 - 0
Pal/src/host/Skeleton/Makefile

@@ -17,6 +17,7 @@ objs	= $(addprefix db_,files devices pipes sockets streams memory threading \
 graphene_lib = ../../../lib/graphene-lib.a
 headers	= $(wildcard *.h) $(wildcard ../../*.h) $(wildcard ../../../lib/*.h)
 
+.PHONY: all
 all: $(host_target)
 
 ifeq ($(DEBUG),1)
@@ -45,5 +46,6 @@ libpal-Skeleton.a: $(addsuffix .o,$(objs)) $(graphene_lib)
 	@echo [ host/$(PAL_HOST)/$@ ]
 	@$(AS) $(ASFLAGS) $(defs) -c $< -o $@
 
+.PHONY: clean
 clean:
 	rm -f $(addsuffix .o,$(objs)) $(host_target)

+ 2 - 0
Pal/src/security/Linux/Makefile

@@ -11,6 +11,7 @@ LDFLAGS	= -shared -nostdlib -z combreloc -z defs --version-script pal-sec.map -e
 objs	= bpf_helper filter main manifest printf
 graphene_lib = ../../.lib/graphene-lib.a
 
+.PHONY: all
 all: libpal_sec.so
 
 ifeq ($(DEBUG),1)
@@ -30,5 +31,6 @@ libpal_sec.so: $(addsuffix .o,$(objs)) $(graphene_lib)
 	@echo [ security/Linux/$@ ]
 	@$(CC) $(CFLAGS) -E $< -o $@
 
+.PHONY: clean
 clean:
 	rm -rf *.o libpal_sec.so

+ 3 - 0
Pal/test/Makefile

@@ -4,6 +4,7 @@ CC	= gcc
 CFLAGS	= -Wall -O2 -std=gnu99 -fgnu89-inline -fno-builtin -nostdlib \
 	  -I../include/pal -I../lib
 
+.PHONY: default
 default: all
 include ../src/Makefile.Test
 
@@ -18,6 +19,7 @@ graphene_lib = .lib/graphene-lib.a
 pal_lib = ../src/libpal.so
 headers = $(wildcard ../include/pal/*.h)
 
+.PHONY: all
 all:	pal_loader $(call expand_target,$(target))
 
 ifeq ($(DEBUG),1)
@@ -50,5 +52,6 @@ $(executables): .packed/test.tar.gz
 	tar -xmozf $< $@
 endif
 
+.PHONY: clean
 clean:
 	rm -rf pal_loader $(call expand_target,$(target)) .lib *.cached

+ 4 - 0
Runtime/Makefile

@@ -1,5 +1,9 @@
+.PHONY: clean
 clean:
 	rm -f libc.so.6 ld-linux-x86-64.so.2 libpthread.so.0 libm.so.6 libdl.so.2 libutil.so.1 crt1.o crti.o crtn.o liblibos.so.1 libnss_dns.so.2 libresolv.so.2 pal_gdb* pal-* pal_sec*
 
+.PHONY: all
 all:
+
+.PHONY: pack
 pack: