scc

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

Makefile (2460B)


      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 PREFIX = $(HOME)
     14 ROOT = $(DESTDIR)$(PREFIX)
     15 NODEP = 1
     16 
     17 all:
     18 	+@PREFIX=$(PREFIX) $(MAKE) `$(SCRIPTDIR)/config` toolchain
     19 	+@$(MAKE) `$(SCRIPTDIR)/config` `uname -m`
     20 
     21 install:
     22 	$(SCRIPTDIR)/install $(ROOT)
     23 	+@$(MAKE) install-`uname -m`
     24 
     25 uninstall:
     26 	$(SCRIPTDIR)/uninstall $(ROOT)
     27 	+@$(MAKE) uninstall-`uname -m`
     28 
     29 #############################################################
     30 # x86_64 rules
     31 
     32 x86_64 amd64:
     33 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-linux libc libcrt
     34 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-openbsd libc libcrt
     35 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-netbsd libc libcrt
     36 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-dragonfly libc libcrt
     37 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=amd64-darwin libc libcrt
     38 
     39 install-x86_64 install-amd64: amd64
     40 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.amd64 $(ROOT)
     41 
     42 uninstall-x86_64 uninstall-amd64:
     43 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.amd64 $(ROOT)
     44 
     45 #############################################################
     46 # i386 rules
     47 
     48 i386:
     49 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=i386-linux libc libcrt
     50 
     51 install-i386: i386
     52 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.i386 $(ROOT)
     53 
     54 uninstall-i386:
     55 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.i386 $(ROOT)
     56 
     57 #############################################################
     58 # ppc rules
     59 
     60 ppc:
     61 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=ppc-linux libc libcrt
     62 
     63 install-ppc: ppc
     64 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.ppc $(ROOT)
     65 
     66 uninstall-ppc:
     67 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.ppc $(ROOT)
     68 
     69 #############################################################
     70 # arm rules
     71 
     72 arm:
     73 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=arm-linux libc libcrt
     74 
     75 install-arm: arm
     76 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.arm $(ROOT)
     77 
     78 uninstall-arm:
     79 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.arm $(ROOT)
     80 
     81 #############################################################
     82 # arm64 rules
     83 
     84 arm64:
     85 	+@$(MAKE) `$(SCRIPTDIR)/config` CONF=arm64-linux libc libcrt
     86 
     87 install-arm64: arm64
     88 	$(SCRIPTDIR)/install -p $(SCRIPTDIR)/proto.arm64 $(ROOT)
     89 
     90 uninstall-arm64:
     91 	$(SCRIPTDIR)/uninstall -p $(SCRIPTDIR)/proto.arm64 $(ROOT)
     92 
     93 toolchain: dirs src
     94 libc: dirs src/libc
     95 libcrt: dirs src/libcrt
     96 src: include/scc/scc
     97 tests: all
     98 
     99 dirs: $(SCRIPTDIR)/libc-dirs
    100 	xargs mkdir -p < $(SCRIPTDIR)/libc-dirs
    101 	touch dirs
    102 
    103 clean:
    104 	xargs rm -rf < $(SCRIPTDIR)/libc-dirs
    105 	rm -f dirs