fork(), wait(), exec() in C - Video 2/2
10001 views
This is the second video on fork(), wait(), and exec() in C. For CS370 Homework 2.
MAKEFILE
------------------
#list of files
C_SRCS = Fork.c ChildTask.c
C_OBJS = Fork.o ChildTask.o
#C_HEADERS
OBJS = ${C_OBJS}
EXE1 = fork
EXE2 = childTask
#compiler and loader commands and flags
GCC = gcc
GCC_FLAGS = -std=c11 -g -Wall -c -I.
LD_FLAGS = -std=c11 -g -Wall -I.
#compile .c files to .o files
.c.o:
$(GCC) $(GCC_FLAGS) $<
#target is the executable
all: fork childTask
fork: Fork.o
$(GCC) $(LD_FLAGS) Fork.o -o $(EXE1)
childTask: ChildTask.o
$(GCC) $(LD_FLAGS) ChildTask.o -o $(EXE2)
#recomplile c objects if headers change
$(C_OBJS): ${C_HEADERS}
#clean up directory
clean:
rm -f *.o *- $(EXE1) $(EXE2)
package:
zip -r submission.zip Fork.c ChildTask.c Makefile README.txt
Suggested Videos
03:05
Run Script for C Programs
2674 views
03:04
REMIX: A web-based IDE for SOLIDITY
1887 views
01:55
Certificate Installation on MacOS with Google Chrome
1441 views
04:40
Running Your Container in Kubernetes
2401 views
02:00
Basic Git Tutorial Part 1: Set-up and Committing Files
3211 views
01:57
Dockerfiles - Part 1
1740 views
02:00
Launching Storm daemons Under Supervision
2756 views
00:45
Choosing a Remote Machine for SSH
3747 views
01:19
Being a Good Citizen on Piazza
1785 views
02:07
Uploading a Docker Image to DockerHub
2372 views
01:02
Java - Java's File and Class Naming Rule
29 views
02:00
Apache Spark - Setting Up a Spark Cluster
6895 views
02:08
Setting up a package structure in Java
1343 views
01:57
Java NIO - Client Example
2057 views
01:40
Java - Reading Input With Scanner
19 views