Makefile 891 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. SYS ?= $(shell gcc -dumpmachine)
  2. CC = gcc
  3. CFLAGS = -Wall -O2 -std=gnu99 -fgnu89-inline -fno-builtin -nostdlib \
  4. -I../include/pal -I../lib
  5. executables = HelloWorld File Failure Thread Fork Event Process Exception \
  6. Memory Pipe Tcp Udp Yield Broadcast Ipc Server Wait HandleSend \
  7. Select Segment
  8. manifests = manifest
  9. target = $(executables) $(manifests)
  10. graphene_lib = ../lib/graphene-lib.a
  11. pal_lib = ../src/libpal.so
  12. headers = $(wildcard ../include/pal/*.h)
  13. all: $(target)
  14. debug: CC=gcc -g
  15. debug: $(target)
  16. manifest: manifest.template
  17. cp -f manifest.template manifest
  18. ifeq ($(SYS),x86_64-linux-gnu)
  19. $(executables): %: %.c $(graphene_lib) $(pal_lib) ../src/user_start.o
  20. @echo [ $@ ]
  21. @$(CC) $(CFLAGS) $^ -o $@
  22. .PHONY: pack
  23. pack: $(executables)
  24. tar -czf .packed/test.tar.gz $^
  25. else
  26. $(executables): .packed/test.tar.gz
  27. tar -xmozf $<
  28. endif
  29. clean:
  30. rm -rf $(target)