#include "gnuccompiler.h"
#include "gnucxxcompiler.h"
#include "gnulinker.h"
-#include "header.h"
#include "installedfile.h"
#include "misc.h"
#include "package.h"
#include "datafile.h"
#include "executable.h"
#include "file.h"
-#include "header.h"
#include "objectfile.h"
#include "sharedlibrary.h"
+#include "sourcefile.h"
#include "sourcepackage.h"
#include "staticlibrary.h"
#include "tarball.h"
{
FileTarget *hdr = builder.get_vfs().get_target(*i);
if(!hdr)
- hdr = new Header(builder, *this, i->str());
+ hdr = new SourceFile(builder, *this, *i);
// Install headers if requested
if(type==HEADERS && install)
+++ /dev/null
-#ifndef HEADER_H_
-#define HEADER_H_
-
-#include "component.h"
-#include "sourcefile.h"
-
-/**
-Represents a header file. Mainly exists to give extra information to the user.
-*/
-class Header: public SourceFile
-{
-protected:
- Header(Builder &b, const std::string &f): SourceFile(b, f) { }
-public:
- Header(Builder &b, const Component &c, const std::string &f): SourceFile(b, c, f) { install_location = "include/"+c.get_name(); }
- virtual const char *get_type() const { return "Header"; }
-};
-
-/**
-A header file that doesn't belong to any known package.
-*/
-class SystemHeader: public Header
-{
-public:
- SystemHeader(Builder &b, const std::string &f): Header(b, f) { }
- virtual const char *get_type() const { return "SystemHeader"; }
-};
-
-#endif
#include "copy.h"
#include "executable.h"
#include "datafile.h"
-#include "header.h"
#include "installedfile.h"
#include "package.h"
#include "pkgconfig.h"
SourceFile::SourceFile(Builder &b, const Component &c, const FS::Path &p):
FileTarget(b, &c.get_package(), p),
comp(&c)
-{ }
+{
+ string ext = FS::extpart(FS::basename(path));
+ if(ext==".h" || ext==".H" || ext==".hpp")
+ install_location = "include/"+comp->get_name();
+}
void SourceFile::find_depends()
{
const Component *comp;
StringList includes;
-protected:
- SourceFile(Builder &, const Msp::FS::Path &);
public:
+ SourceFile(Builder &, const Msp::FS::Path &);
SourceFile(Builder &, const Component &, const Msp::FS::Path &);
+
virtual const char *get_type() const { return "SourceFile"; }
const StringList &get_includes() const { return includes; }
const Component *get_component() const { return comp; }
#include <msp/strings/utils.h>
#include "builder.h"
#include "misc.h"
-#include "header.h"
#include "sharedlibrary.h"
+#include "sourcefile.h"
#include "systemlibrary.h"
#include "virtualfilesystem.h"
if(FS::is_reg(fn))
{
- tgt = new SystemHeader(builder, fn.str());
+ tgt = new SourceFile(builder, fn);
return tgt;
}
return 0;