Enabled VPATH feature: changed nearly all Makefiles (149 files).
[fw/sdcc] / support / cpp2 / Makefile.in
index 8607c0759084e3a24f1dfe0e1459b1a110170a7f..90cf7293b2ad0974b2ed8791ed77c3bc2595ba78 100644 (file)
 #the Free Software Foundation, 59 Temple Place - Suite 330,
 #Boston MA 02111-1307, USA.
 
-PRJDIR = ../..
-TARGET = $(PRJDIR)/bin/sdcpp
+EXEEXT = @EXEEXT@
+TARGET = ../../bin/sdcpp$(EXEEXT)
+
+VPATH  = @srcdir@
 
 # This is the default target.
 all: $(TARGET)
@@ -34,9 +36,11 @@ srcdir = @srcdir@
 
 
 LIBS = @LIBS@
+CFLAGS = @CFLAGS@
 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) \
   $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
+LDFLAGS = @LDFLAGS@
 
 CC = @CC@
 AR = ar
@@ -90,7 +94,7 @@ exeext = @host_exeext@
 transform       = @program_transform_name@
 
 # Top build directory, relative to here.
-top_builddir = .
+top_builddir = @top_builddir@
 
 # Whether we were configured with NLS.
 USE_NLS = @USE_NLS@
@@ -105,16 +109,18 @@ OBSTACK=obstack.o
 # End of variables for you to override.
 
 install: all
-       mkdir -p $(bindir)
-       $(INSTALL) $(TARGET) `echo $(bindir)/sdcpp|sed '$(transform)'`
-       $(STRIP) `echo $(bindir)/sdcpp|sed '$(transform)'`
+       mkdir -p $(DESTDIR)$(bindir)
+       $(INSTALL) $(TARGET) `echo $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)|sed '$(transform)'`
+       $(STRIP) `echo $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)|sed '$(transform)'`
 
+uninstall:
+       rm -f $(DESTDIR)$(bindir)/sdcpp$(EXEEXT)
 clean:
        -rm -f $(TARGET) *.o core libcpp.a
 
 distclean: clean
        -rm -f auto-host.h auto-build.h cstamp-h Makefile
-       -rm -f config.status config.run config.cache config.bak config.log *~
+       -rm -f configargs.h config.status config.run config.cache config.bak config.log *~
 
 # This tells GNU Make version 3 not to put all variables in the environment.
 .NOEXPORT:
@@ -140,7 +146,7 @@ SYSTEM_H = system.h hwint.h
 #@build_overrides@
 #\f
 
-INCLUDES = -I$(srcdir) -I$(LIBIBERTY_DIR)
+INCLUDES = -I$(srcdir) -I$(LIBIBERTY_DIR) -I.
 
 # Always use -I$(srcdir)/config when compiling.
 .c.o:
@@ -218,6 +224,7 @@ MY_LIBIBERTY_BITS = safe-ctype.o obstack.o splay-tree.o \
                    lbasename.o
 
 $(TARGET): cppmain.o intl.o $(MY_LIBIBERTY_BITS) libcpp.a $(LIBDEPS) 
+       mkdir -p $(dir $@)
        $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cppmain.o \
        $(MY_LIBIBERTY_BITS) libcpp.a $(LIBS)