Executing large Coq project with many files - makefile

I have a Coq project with a number of files (say x1.v, x2.v, ... xn.v) including a Makefile stored in folder "C:\Users\WK\Desktop\Personal\coq-project" and have installed Coq 8.3 at "C:\Coq" on my Windows 7 machine.
The Coq programs (files) are dependent on each other. How can I execute a single program (say x1.v) in Coq? I want to open a file in Coq and compile line by line to understand it, but it gives errors as there are many imported files in each, with no one in (.vo) format. I think there is some use of commands coqc, coqtop, make or any combination of these but I dont know the exact format of commands, arguments, and order. Please let me give complete commands with full paths keep in mind the above paths.
Thanks,
Wilayat

just run make
It should create all the .vo files, if your Makefile is correct.

Related

How to build Go without the literal bin, pkg, and src directories?

I am new to the Go programming language. I am hoping to integrate Go code, if possible, into existing code that contains heterogeneous code. My present organization of code is:
<reverse-TLD>/<component-path>/<code><extension>
where:
<reverse-TLD> is the domain with parts reversed. For example, com.mydomain.mysubdomain.
<component-path> is 1 or more subdirectories under which code lives. For example, image/jpeg.
<code> is the part of a code filename before the extension. For example, jpeg2000.
<extension> is the extension. For example, .sh, .py, etc. For example, this taken with the other elements above would have a path: com.mydomain.mysubdomain/image/jpeg/jpeg2000.go.
Note that code files other than Go files are in the same directory as Go files.
My issues are:
My existing structure above doesn't include src, pkg, or bin directories. Are there environment or Go env variables that allow me to specify these directories?
The directory <reverse-TLD> and all files under it is read-only. I need the output of the compilation to be based under another directory, given as $BUILD_DIR. That directory can have whatever directories are needed under it.
I am thinking that as a convention, I could use lowercase filenames for Go code that will become an executable command and leading-uppercase filenames for Go code that will become package objects. Is there a best practice naming convention for making this distinction in the Go community?
Is there any problem with my using reverse TLDs? For example, com.mydomain.mysubdomain vs. mysubdomain.mydomain.com.
If the src, pkg, and bin directories are hard requirements, then I think I'll have to write a script that finds Go files and copies them to a temporary directory that meets the requirements, compile them, and then move the built artifacts to the $BUILD_DIR. But, I'm hoping that Go is flexible enough to allow me to do this.
If it is possible, could you show me the commands or environment variables that are needed to compile given the constraints above? And, comments on items 1-4 above are appreciated. Thank you!
That against Go's conventions and is not a recommended practice

Expressions in a build rule "Output Files"?

Can you include expressions in the "Output Files" section of a build rule in Xcode? Eg:
$(DERIVED_FILE_DIR)$(echo "/dynamic/dir")/$(INPUT_FILE_BASE).m
Specifically, when translating Java files with j2objc, the resulting files are saved in subfolders, based on the java packages (eg. $(DERIVED_FILE_DIR)/com/google/Class.[hm]). This is without using --no-package-directories, which I can't use because of duplicate file names in different packages.
The issue is in Output Files, because Xcode doesn't know how to search for the output file at the correct location. The default location is $(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).m, but I need to perform a string substitution to insert the correct path. However any expression added as $(expression) gets ignored, as it was never there.
I also tried to export a variable from the custom script and use it in Output Files, but that doesn't work either because the Output Files are transformed into SCRIPT_OUTPUT_FILE_X before the custom script is ran.
Unfortunately, Xcode's build support is pretty primitive (compared to say, make, which is third-odd years older :-). One option to try is splitting the Java source, so that the two classes with the same names are in different sub-projects. If you then use different prefixes for each sub-project, the names will be disambiguated.
A more fragile, but maybe simpler approach is to define a separate rule for the one of the two classes, so that it can have a unique prefix assigned. Then add an early build phase to translate it before any other Java classes, so the rules don't overlap.
For me, the second alternative does work (Xcode 7.3.x) - to a point.
My rule is not for Java, but rather for Google Protobuf, and I tried to maintain the same hierarchy (like your Java package hierarchy) in the generated code as in the source .proto files. Indeed files (.pb.cc and .pb.h) were created as expected, with their hierarchies, inside the Build/Intermediates/myProject.build/Debug/DerivedSources directory.
However, Xcode usually knows to continue and compile the generated output into the current target - but that breaks as it only looks for files in the actual ${DERIVED_FILE} - not within sub-directories underneath.
Could you please explain better "Output Files are transformed into SCRIPT_OUTPUT_FILE_X" ? I do not understand.

Creating a Continuous File Reading-Executing Shell Script

I need to write something that will read and execute all the files(Mainly executable scripts) inside one or more folders; in other words, a continuous chain with a break when finished. I'm new to shell and need syntax help. I'm on Ubuntu 12.10-Gnome btw.
Here are some main highlights I think should be included;
-The program should ask for one or more directories. Should process all the files given in these directories,
-Should create a .txt file on which files and folders are read and executed(for correction and informational purposes),
-Could contain a break option like control+shift+c maybe but thats clearly not of utmost importance.
The code, or the guidance to the code would be very much appreciated. Thx alot.

How to use the "Project Drawer" in TextMate 2 when it doesn't seem to exist?

On TextMate 2 and opening two files in two different locations such as /path/1/file.txt and /path/2/file.txt, I am no longer seeing a way to perform diffs as before since one cannot select files in the project "drawer." We now have a file browser that seems to have taken its place and thus no way to pick the two opposing files. This also precludes any other command that requires multi file selection that are not within the file structure.
Am I missing something that would allow this to work properly when dealing with files in two different paths?
This isn't a new trick. It's one we learned when grep in project would go insane when you had a project with files whose common ancestor was root or some directory far above the files. Instead of opening your files like:
mate /foo/bar/baz /quix/quacks/quux
You do the following, assuming you're in an empty directory or don't care that its files will be included in the project as well
ln /foo/bar/baz /quix/quacks/quux . && mate .
That can obviously be wrapped up into a function to reduce the syntactical difference. In fact, at one point, I actually wrote a wrapper script around mate to do that transparently when needed AND clean up the hard linked files after I closed the project or quit TextMate. That went away with some bad hard drive though.
Anyhow I HTH

Executable Files - how to identify them in ASCII

It looks like all EXE files begin with MZ when they are opened in ASCII mode, is there an ASCII identified for vbs, com and bat files as well? i can't seem to find a pattern...
Or maybe there's another way to identify them? aside from just the extension...
No, not really (Windows executables can have PE or PK at the beginning instead of MZ - see this for other possible formats).
For other types of files, there are certain heuristics you can use (e.g. GIF files start with "GIF89", Bash shell scripts usually start with #!/bin/bash, BAT files often execute #echo off at the beginning, VBS scripts use apostrophe at the start of line as a comment marker), but they aren't always 100% reliable (a file can be both a BAT script and a Bash shell script; or a file that's both a valid ZIP archive and a valid GIF image (like that stegosaurus image), for example).
See e.g. this article for further reading.
TrID seems to have a "standalone" application you could probably use and pass the file in and read the contents out and see what file it is. It prides itself on the ability to pass it a generic file (extension or without) and it uses the headers of the file to discover what file type it actually is.
See if this tutorial is helpful (How to detect the types of executable files 3 part series). He has even presented a step by step algorithm on how to do this.
Also see this post: How to determine if a file is executable?

Resources