scc

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

Makefile (924B)


      1 .POSIX:
      2 
      3 PROJECTDIR = .
      4 include $(PROJECTDIR)/scripts/rules.mk
      5 
      6 STD = c99
      7 PREFIX    = $(PWD)/$(PROJECTDIR)/root
      8 MANPREFIX = $(PREFIX)/share/man
      9 DIRS  = src include/scc/scc tests
     10 
     11 all: src
     12 
     13 src: dirs include/scc/scc
     14 
     15 dirs: $(SCRIPTDIR)/libc-proto
     16 	xargs mkdir -p < $(SCRIPTDIR)/libc-proto
     17 	touch dirs
     18 
     19 $(DIRS): $(ENVIRON) FORCE
     20 	+@. $(ENVIRON) && cd $@ && $(MAKE)
     21 
     22 $(ENVIRON):
     23 	@rm -f $@; \
     24 	trap 'r=$?;rm -f $$$$.tmp;exit $r' EXIT HUP INT QUIT TERM; \
     25 	echo PATH=$$PATH:$$PWD/$(SCRIPTDIR):. > $$$$.tmp && \
     26 	echo NM=\"$(NM)\" >> $$$$.tmp && \
     27 	echo AR=\"$(AR)\" >> $$$$.tmp && \
     28 	echo RL=\"$(RL)\" >> $$$$.tmp && \
     29 	echo STD=\"$(STD)\" >> $$$$.tmp && \
     30 	echo ARFLAGS=\"$(ARFLAGS)\" >> $$$$.tmp && \
     31 	echo RLFLAGS=\"$(RLFLAGS)\" >> $$$$.tmp && \
     32 	echo export PATH STD ARFLAGS RLFLAGS NM AR RL >> $$$$.tmp && \
     33 	mv $$$$.tmp $@
     34 
     35 dep:
     36 	$(FORALL)
     37 
     38 clean: $(ENVIRON)
     39 	$(FORALL)
     40 	rm -rf lib bin libexec dirs $(ENVIRON)
     41 
     42 tests: all