Making a project distribution folder
(Newb question alert)
I'm trying to make my first c project (a simple tic tac toe console game), and I am wondering how to make a final product (copy all source code files to a distribution folder upon compilation). Should I use a bash script or should I use a makefile to make the distribution folder? I'm not terrible familiar with either; I have a basic makefile to make an executable, and that's about all I know of make. And if I do use a bash script, how do I copy over source code files? I tried cp ./*.c and cp ./*.h, but I think the script read it literally as moving a file named ./*.c (and ./*.h), and couldn't find it. My makefile is pretty much this: Code:
objectFiles = main.o io.o board.o game.o |
1 Attachment(s)
I wrote a script to do that exact thing, I like to keep things simple rather than use a full IDE ... rename to .sh
cheers Attachment 3986 |
Thanks for the script. Though, I already have an existing project with code, except the folder is cluttered with object files and editor backups. So I'm trying to copy all *.h and *.c files to a clean subdirectory (/distr), then zip it upon compiling. Though I don't know how to copy files just based on having a .c or .h. I can do it in the terminal no problem, cp ./*.c ./distr and cp ./*.h ./distr, but that same code wouldn't work in the script.
So pretty much, how do I copy source files in a shell script? So far this is what I have (and it doesn't work): Code:
#!/bin/bash ETA: Found out how to do that. Had to feed ls output to grep. Ye gads I'm horrible with shell scripting. Code:
!/bin/bash |
All times are GMT -5. The time now is 12:02 AM. |