mirror of
https://github.com/intel/linux-sgx
synced 2026-06-08 14:49:32 +00:00
0f61c27a40
Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>
35 lines
595 B
Makefile
35 lines
595 B
Makefile
PACKAGE_NAME=@PACKAGE_NAME@
|
|
PACKAGE_VERSION=@PACKAGE_VERSION@
|
|
CC=@CC@
|
|
CFLAGS=@CFLAGS@ -O2
|
|
CC_VERSION := $(shell $(CC) -dumpversion)
|
|
CC_NO_LESS_THAN_8 := $(shell expr $(CC_VERSION) \>\= "8")
|
|
ifeq ($(CC_NO_LESS_THAN_8), 1)
|
|
CFLAGS += -fcf-protection
|
|
endif
|
|
AR=ar
|
|
|
|
TEST_OBJ=main.o
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
all: bin lib
|
|
|
|
bin: test
|
|
|
|
lib: librdrand.a
|
|
|
|
librdrand.a: rdrand.o
|
|
$(AR) rcs $@ $?
|
|
|
|
test: $(TEST_OBJ) librdrand.a
|
|
$(CC) $(CFLAGS) -o $@ $(TEST_OBJ) -L. -lrdrand
|
|
|
|
clean:
|
|
rm -f *.o librdrand.a test
|
|
|
|
distclean: clean
|
|
rm -f Makefile config.guess config.status config.log config.h
|
|
|