scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

Makefile (2657B)


      1 .POSIX:
      2 
      3 DIRS  =\
      4 	src\
      5 	src/libc\
      6 	src/libcrt\
      7 	include/scc/scc\
      8 	tests\
      9 
     10 PROJECTDIR = .
     11 include $(PROJECTDIR)/scripts/rules.mk
     12 
     13 ROOT = $(DESTDIR)$(PREFIX)
     14 NODEP = 1
     15 
     16 all: config
     17 	+@$(MAKE) `$(SCRIPTDIR)/config -c` toolchain
     18 	+@$(MAKE) `$(SCRIPTDIR)/config` `uname -m`
     19 
     20 config:
     21 	cd include/scc/scc && $(MAKE) $@
     22 
     23 install:
     24 	$(SCRIPTDIR)/install $(ROOT)
     25 	+@$(MAKE) install-`uname -m`
     26 
     27 uninstall:
     28 	$(SCRIPTDIR)/uninstall $(ROOT)
     29 	+@$(MAKE) uninstall-`uname -m`
     30 
     31 #############################################################
     32 # x86_64 rules
     33 
     34 x86_64 amd64:
     35 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-linux libc libcrt
     36 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-openbsd libc libcrt
     37 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-netbsd libc libcrt
     38 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-dragonfly libc libcrt
     39 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-darwin libc libcrt
     40 
     41 install-x86_64 install-amd64: amd64
     42 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.amd64 $(ROOT)
     43 
     44 uninstall-x86_64 uninstall-amd64:
     45 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.amd64 $(ROOT)
     46 
     47 #############################################################
     48 # i386 rules
     49 
     50 i386:
     51 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=i386-linux libc libcrt
     52 
     53 install-i386: i386
     54 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.i386 $(ROOT)
     55 
     56 uninstall-i386:
     57 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.i386 $(ROOT)
     58 
     59 #############################################################
     60 # ppc rules
     61 
     62 ppc:
     63 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=ppc-linux libc libcrt
     64 
     65 install-ppc: ppc
     66 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.ppc $(ROOT)
     67 
     68 uninstall-ppc:
     69 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.ppc $(ROOT)
     70 
     71 #############################################################
     72 # arm rules
     73 
     74 arm:
     75 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=arm-linux libc libcrt
     76 
     77 install-arm: arm
     78 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.arm $(ROOT)
     79 
     80 uninstall-arm:
     81 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.arm $(ROOT)
     82 
     83 #############################################################
     84 # arm64 rules
     85 
     86 arm64:
     87 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=arm64-linux libc libcrt
     88 
     89 install-arm64: arm64
     90 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.arm64 $(ROOT)
     91 
     92 uninstall-arm64:
     93 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.arm64 $(ROOT)
     94 
     95 #############################################################
     96 
     97 toolchain: src
     98 libc: src/libc
     99 libcrt: src/libcrt
    100 
    101 tests: all
    102 src: include/scc/scc
    103 
    104 src: dirs
    105 src/libc: dirs
    106 src/libcrt: dirs
    107 
    108 dirs: $(SCRIPTDIR)/libc-dirs
    109 	xargs mkdir -p < $(SCRIPTDIR)/libc-dirs
    110 	touch dirs
    111 
    112 clean:
    113 	xargs rm -rf < $(SCRIPTDIR)/libc-dirs
    114 	rm -f dirs
    115 
    116 distclean: clean
    117 	rm -f include/scc/scc/sysld.h
    118 	rm -f include/scc/scc/sysincludes.h