|
@@ -1,9 +1,8 @@
|
|
-special_executables = bootstrap_static bootstrap_pie shared_object openmp
|
|
+c_executables = $(patsubst %.c,%,$(wildcard *.c))
|
|
-c_executables = $(filter-out $(special_executables),$(patsubst %.c,%,$(wildcard *.c)))
|
|
|
|
cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
|
|
cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
|
|
manifests = $(patsubst %.manifest.template,%.manifest,$(wildcard *.manifest.template)) manifest
|
|
manifests = $(patsubst %.manifest.template,%.manifest,$(wildcard *.manifest.template)) manifest
|
|
|
|
|
|
-exec_target = $(special_executables) $(c_executables) $(cxx_executables)
|
|
+exec_target = $(c_executables) $(cxx_executables)
|
|
target = $(exec_target) $(manifests)
|
|
target = $(exec_target) $(manifests)
|
|
|
|
|
|
clean-extra += clean-tmp
|
|
clean-extra += clean-tmp
|
|
@@ -12,46 +11,27 @@ clean-extra += clean-tmp
|
|
default: all
|
|
default: all
|
|
|
|
|
|
level = ../
|
|
level = ../
|
|
|
|
+include ../../../../Makefile.configs
|
|
|
|
+include ../../../../Makefile.rules
|
|
include ../Makefile
|
|
include ../Makefile
|
|
|
|
|
|
-CFLAGS-libos = -L../../../build/libos -I../../include
|
|
|
|
-
|
|
|
|
ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
|
|
ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
|
|
-$(c_executables): %: %.c
|
|
|
|
- @echo [ $@ ]
|
|
|
|
- @$(CC) $(CFLAGS) $(if $(findstring .libos,$@),$(CFLAGS-libos),) -o $@ $< \
|
|
|
|
- $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
|
|
|
|
-
|
|
|
|
-$(cxx_executables): %: %.cpp
|
|
|
|
- @echo [ $@ ]
|
|
|
|
- @$(CXX) $(CXXFLAGS) -o $@ $< \
|
|
|
|
- $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
|
|
|
|
|
|
|
|
-bootstrap_static: %: %.c
|
|
+CFLAGS-bootstrap_static = -static
|
|
- @echo [ $@ ]
|
|
+CFLAGS-bootstrap_pie = -fPIC -pie
|
|
- @$(CC) $(CFLAGS) -o $@ -static $< \
|
|
+CFLAGS-shared_object = -fPIC -pie
|
|
- $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
|
|
+CFLAGS-syscall += -I$(PALDIR)/../include -I$(PALDIR)/host/$(PAL_HOST)
|
|
|
|
+CFLAGS-openmp = -fopenmp
|
|
|
|
|
|
-bootstrap_pie: %: %.c
|
|
+$(c_executables): %: %.c
|
|
- @echo [ $@ ]
|
|
+ $(call cmd,csingle)
|
|
- @$(CC) $(CFLAGS) -fPIC --pie -o $@ $< \
|
|
|
|
- $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
|
|
|
|
-
|
|
|
|
-shared_object: %: %.c
|
|
|
|
- @echo [ $@ ]
|
|
|
|
- @$(CC) $(CFLAGS) -o $@ -fPIC -pie $< \
|
|
|
|
- $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
|
|
|
|
-
|
|
|
|
-syscall: CFLAGS += -I$(PALDIR)/../include -I$(PALDIR)/host/$(PAL_HOST)
|
|
|
|
|
|
|
|
-openmp: %: %.c
|
|
+$(cxx_executables): %: %.cpp
|
|
- @echo [ $@ ]
|
|
+ $(call cmd,cxxsingle)
|
|
- @$(CC) $(CFLAGS) -o $@ -fopenmp $< \
|
|
|
|
- $(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
|
|
|
|
|
|
|
|
else
|
|
else
|
|
-.IGNORE: $(special_executables) $(c_executables) $(cxx_executables)
|
|
+.IGNORE: $(c_executables) $(cxx_executables)
|
|
-$(special_executables) $(c_executables) $(cxx_executables):
|
|
+$(c_executables) $(cxx_executables):
|
|
endif
|
|
endif
|
|
|
|
|
|
export PAL_LOADER = $(RUNTIME)/pal-$(PAL_HOST)
|
|
export PAL_LOADER = $(RUNTIME)/pal-$(PAL_HOST)
|