scc

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

rules.mk (1426B)


      1 CONF=amd64-linux
      2 TOOL=unix
      3 include $(PROJECTDIR)/config/$(CONF).mk
      4 include $(PROJECTDIR)/config/toolchain/$(TOOL).mk
      5 
      6 LIBDIR     = $(PROJECTDIR)/lib/scc
      7 SCRIPTDIR  = $(PROJECTDIR)/scripts
      8 INCDIR     = $(PROJECTDIR)/include
      9 
     10 BINDIR     = $(PROJECTDIR)/bin
     11 LIBEXEC    = $(PROJECTDIR)/libexec/scc
     12 CRTDIR     = $(PROJECTDIR)/lib/scc
     13 LIBCDIR    = $(CRTDIR)/$(ARCH)-$(SYS)/
     14 ENVIRON    = $(SCRIPTDIR)/env.sh
     15 
     16 INCLUDE    = -I$(INCDIR)/scc \
     17 
     18 CC = $(CROSS_COMPILE)$(COMP)
     19 AS = $(CROSS_COMPILE)$(ASM)
     20 LD = $(CROSS_COMPILE)$(LINKER)
     21 RL = $(CROSS_COMPILE)$(RANLIB)
     22 AR = $(CROSS_COMPILE)$(ARCHIVE)
     23 
     24 SCC_CFLAGS = $(MORECFLAGS) \
     25              $(TOOLCFLAGS) \
     26              $(SYSCFLAGS) \
     27              $(INCLUDE) \
     28              -g \
     29              $(CFLAGS)
     30 
     31 SCC_LDFLAGS = $(MORELFLAGS) \
     32               $(TOOLLDFLAGS) \
     33               $(SYSLDFLAGS) \
     34               -L$(LIBDIR) \
     35               -g \
     36               $(LDFLAGS)
     37 
     38 SCC_ASFLAGS = $(MOREASFLAGS) \
     39               $(TOOLASFLAGS) \
     40               $(SYSASFLAGS) \
     41               $(ASFLAGS)
     42 
     43 # helper macro to run over all the directories
     44 FORALL = +@set -e ;\
     45 	pwd=$$PWD; \
     46 	. $(ENVIRON); \
     47 	for i in $(DIRS); \
     48 	do \
     49 		cd $$i; \
     50 		$(MAKE) $@; \
     51 		cd $$pwd; \
     52 	done
     53 
     54 .o:
     55 	$(CC) $(SCC_LDFLAGS) -o $@ $< $(LIBS)
     56 
     57 .s.o:
     58 	$(AS) $(SCC_ASFLAGS) $< -o $@
     59 
     60 .c.o:
     61 	$(CC) $(SCC_CFLAGS) -o $@ -c $<
     62 
     63 all:
     64 
     65 dep:
     66 
     67 inc-dep: FORCE
     68 	mkdep
     69 
     70 clean: clean-helper
     71 
     72 clean-helper:
     73 	rm -f *.o $(OBJS) $(TARGET)
     74 
     75 FORCE: