Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2012-03-12 04:39:05 +0000
committerMarc-Andre Laperle2012-03-12 04:39:05 +0000
commit863ac9d61ba4066699b49a5a46a077036a26c2b6 (patch)
treefd629faff74e74de32a92acf018161cd13f8add0 /build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StaticTargetRule.java
parent4be0276d23c95deaaedb7ac41e57b8f8c322b7be (diff)
downloadorg.eclipse.cdt-863ac9d61ba4066699b49a5a46a077036a26c2b6.tar.gz
org.eclipse.cdt-863ac9d61ba4066699b49a5a46a077036a26c2b6.tar.xz
org.eclipse.cdt-863ac9d61ba4066699b49a5a46a077036a26c2b6.zip
Bug 368069 - RFE: Contribute Autotools plug-ins to the CDT
Diffstat (limited to 'build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StaticTargetRule.java')
-rw-r--r--build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StaticTargetRule.java68
1 files changed, 68 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StaticTargetRule.java b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StaticTargetRule.java
new file mode 100644
index 00000000000..c630122590b
--- /dev/null
+++ b/build/org.eclipse.cdt.autotools.ui/src/org/eclipse/cdt/internal/autotools/ui/editors/automake/StaticTargetRule.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.autotools.ui.editors.automake;
+
+/**
+ * Here is the syntax of a static pattern rule:
+ *
+ * TARGETS ...: TARGET-PATTERN: DEP-PATTERNS ...
+ * COMMANDS
+ * ...
+ */
+public class StaticTargetRule extends InferenceRule implements IInferenceRule {
+
+ String targetPattern;
+ String[] prereqPatterns;
+
+ public StaticTargetRule(Directive parent, Target target, String target_pattern, String[] prereq_patterns, Command[] commands) {
+ super(parent, target, commands);
+ targetPattern = target_pattern;
+ prereqPatterns = prereq_patterns.clone();
+ }
+
+ public String[] getPrerequisitePatterns() {
+ return prereqPatterns.clone();
+ }
+
+ public void setPrerequisitePatterns(String[] prereqs) {
+ prereqPatterns = prereqs.clone();
+ }
+
+ public String getTargetPattern() {
+ return targetPattern;
+ }
+
+ public void setTargetPattern(String target_pattern) {
+ targetPattern = target_pattern;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(getTarget()).append(':');
+ String pattern = getTargetPattern();
+ if (pattern != null && pattern.length() > 0) {
+ buffer.append(' ').append(targetPattern);
+ }
+ buffer.append(':');
+ for (int i = 0; i < prereqPatterns.length; i++) {
+ buffer.append(' ').append(prereqPatterns[i]);
+ }
+ buffer.append('\n');
+ ICommand[] cmds = getCommands();
+ for (int i = 0; i < cmds.length; i++) {
+ buffer.append(cmds[i].toString());
+ }
+ return buffer.toString();
+ }
+}

Back to the top