# Global rules and definitions
# This is included near the top of every Makefile (after TOP is set)

CC=gcc
KERNCC=gcc	# Do not define this as $(CC)
CPP=$(CC)
CXX=g++

# Debugging/optimisation
DEBUG=-g -O

# profiling flags
PROF=

# Warnings
WARN=-Wall -Wno-unused

#Extra ld flags
XLDFLAGS=

# Extra C and C++ flags
# Individual makefiles can change CFLAGS and CXXFLAGS, but
# global additions can be made here
XCFLAGS=$(PROF) $(DEBUG) $(WARN)
XCXXFLAGS=$(PROF) $(DEBUG) $(WARN) #-fno-for-scope

.cc.o:
	$(CXX) -c $(CXXFLAGS) $(XCXXFLAGS) $<

.c.o:
	$(CC) -c $(CFLAGS) $(XCFLAGS) $<

.cc.s:
	$(CXX) -S $(CXXFLAGS) $(XCXXFLAGS) $<

.c.s:
	$(CC) -S $(CFLAGS) $(XCFLAGS) $<

all::

# Specific targets
DEPLIBUSERFS=$(TOP)/lib/libuserfs.a
LIBUSERFS=-L$(TOP)/lib -luserfs

DEPLIBLWP=$(TOP)/lwp/liblwp.a
LIBLWP=-L$(TOP)/lwp -llwp

GENDIR=$(TOP)/genser
GENHDR=$(GENDIR)/genhdr
GENCODE=$(GENDIR)/gencode

$(GENHDR) $(GENCODE) $(DEPLIBUSERFS) $(DEPLIBLWP): dummy
	$(MAKE) -C $(@D) $(@F)


#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif

dummy:

