Compiling C programs with Multiple Files

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ส.ค. 2024
  • Patreon ➤ / jacobsorber
    Courses ➤ jacobsorber.th...
    Website ➤ www.jacobsorbe...
    ---
    Make videos referenced in the video:
    • Learn make in 60 seconds.
    • More make: automatic v...
    ***
    Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
    About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
    More about me and what I do:
    people.cs.clem...
    persist.cs.clem... Note that any Amazon links in my video descriptions are generated by Amazon. If you click one of them and then buy something it helps support this channel. Thanks.
    ***
    Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
    About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
    More about me and what I do:
    www.jacobsorbe...
    people.cs.clem...
    persist.cs.clem...
    To Support the Channel:
    + like, subscribe, spread the word
    + contribute via Patreon --- [ / jacobsorber ]
    + rep the channel with nerdy merch --- [teespring.com/...]
    Source code is also available to Patreon supporters. --- [jsorber-youtub...]
    Want me to review your code?
    Email the code to js.reviews.code@gmail.com. Code should be simple and in one of the following languages: C, C++, python, java, ruby. You must be the author of the code and have rights to post it. Please include the following statement in your email: "I attest that this is my code, and I hereby give Jacob Sorber the right to use, review, post, comment on, and modify this code on his videos."
    You can also find more info about code reviews here.
    • I want to review your ...

ความคิดเห็น • 55

  • @AlexN5142
    @AlexN5142 3 ปีที่แล้ว +17

    Didn't know you had a youtube channel! You were my professor for Operating systems at Clemson

    • @JacobSorber
      @JacobSorber  3 ปีที่แล้ว +14

      Cool. Welcome to the channel. Hope things have gone well post-Clemson.

    • @user-ww2lc1yo9c
      @user-ww2lc1yo9c 5 หลายเดือนก่อน +1

      @@JacobSorber Where is your whole entire complete full course on Operating Systems? Do you teach Windows Kernel Mode Programming?

  • @xy8817
    @xy8817 4 ปีที่แล้ว +8

    These are the best videos on C I have come across on youtube would recommend 10 / 10

    • @xy8817
      @xy8817 3 ปีที่แล้ว

      @Carmelo Bruce nice I will keep that in mind, ty

  • @rustycherkas8229
    @rustycherkas8229 2 ปีที่แล้ว +8

    Long ago, a clever co-worker on a resource starved system used for lots of text processing implemented a "spell checker" using make. Unique words were pulled from a file, the list sorted, then words were tested to exist in a dictionary. Finally, remaining unknown words were left for the user to find and correct in documents. (I should clarify that this system had virtual memory to swap in/out of its 512kb of core RAM...) I recall there were other features to his makefiles, perhaps something like building a TOC or index, too... Long, long ago...

  • @dc1049
    @dc1049 6 ปีที่แล้ว +6

    Thank you for making this video, it answered questions and had suggestions I haven't been able to find anywhere else.

    • @JacobSorber
      @JacobSorber  6 ปีที่แล้ว

      Your welcome. Glad it helped.

    • @bentleydarwin7979
      @bentleydarwin7979 3 ปีที่แล้ว

      i realize it is quite off topic but do anybody know of a good website to watch newly released movies online ?

    • @casperes0912
      @casperes0912 3 ปีที่แล้ว

      @@bentleydarwin7979 You can typically buy them from iTunes pretty quickly after release

  • @Vnifit
    @Vnifit 2 ปีที่แล้ว +2

    Holy shit thank you for making that distiction about the toolchain! I had heard that term being used many times and I never understood what it meant. I of course knew what a compiler was, but did not realize that the actual act of taking code to executable was an act not just by the compiler, but by multiple tools in a row; a toolchain. This video was worth it just to learn that, thank you!

  • @siddharthupadhyay6347
    @siddharthupadhyay6347 4 ปีที่แล้ว +5

    As a small and flexible tool,make is a really efficient one.I have read that it can be used in automating various processes.According to you,where do you think it would be best to use it ?

  • @limitless1692
    @limitless1692 4 ปีที่แล้ว +7

    Wow half an hour to compile a C program
    Hmmm that must be a pretty big program
    C rocks !!

  • @lmatheuss
    @lmatheuss 4 ปีที่แล้ว +1

    What a great video! Thanks for this!

  • @techInk-X
    @techInk-X ปีที่แล้ว

    Thanks a great deal
    This video really helped me

  • @Felix-ve9hs
    @Felix-ve9hs ปีที่แล้ว

    Not even 2 Minutes and I already understood what a toolchain is

  • @ammartirmizi
    @ammartirmizi 3 ปีที่แล้ว +1

    Can you kindly do a video on linker scripts? How the memory mapping works. Thanks.

  • @neillunavat
    @neillunavat 3 ปีที่แล้ว +1

  • @rodrigosandler5890
    @rodrigosandler5890 3 หลายเดือนก่อน

    Does someone know what icons extension he uses? I'd like my .h files to have this purple C but I didn't find one that does it yet

  • @paulortalex6613
    @paulortalex6613 4 ปีที่แล้ว +12

    And if my program has got multiple programming languages

    • @superduper6090
      @superduper6090 ปีที่แล้ว

      then you probably just use a shell script

  • @kr4bz
    @kr4bz 11 หลายเดือนก่อน

    Nice video! Do you ever use CMake?

  • @nikhil182
    @nikhil182 3 ปีที่แล้ว

    Thank you sir:)

  • @aabdev
    @aabdev ปีที่แล้ว

    How to compose multifile universal makefile?

  • @jvencespt
    @jvencespt 3 ปีที่แล้ว +1

    Nice video, but man, I slowed your video and it is still fast in some parts! Nice work

  • @tahmidurrahman5119
    @tahmidurrahman5119 4 ปีที่แล้ว

    I learned a lot...keep making videos

  • @coachremmy
    @coachremmy 3 ปีที่แล้ว

    thanks for this great video

  • @samplesandtests
    @samplesandtests ปีที่แล้ว

    your videos are great, but there is only so much that can be included in a TH-cam video before it becomes to 'dry'. i am reviewing " The GNU Make Manual". is there any resources you could recommend on make that is somewhere between the details in the make manual and the easy of learning of your videos? I tend to use bash build scripts but the versatility in using make is appealing. thank you

  • @anshul493
    @anshul493 3 ปีที่แล้ว

    compiler has many stages like semantic analysis

  • @hrushirajg9991
    @hrushirajg9991 3 หลายเดือนก่อน

    Can anyone help me with makefile with multiple subfolders and files

  • @scdidkr9932
    @scdidkr9932 6 ปีที่แล้ว +2

    Isn't compiling multiple files at the same time the purpose of a makefile?

    • @JacobSorber
      @JacobSorber  6 ปีที่แล้ว +1

      Yes. That's usually what we use Makefiles for.

  • @brucelytle1144
    @brucelytle1144 ปีที่แล้ว

    Ha! I can compile a kernel in a half hour these days? used to take 3-4 hours on my 486!

  • @piano_arts_2007
    @piano_arts_2007 2 ปีที่แล้ว

    what compiler you used ?

  • @RockTo11
    @RockTo11 4 ปีที่แล้ว

    How can a makefile be used for a project containing both C and C++ source files?

    • @JacobSorber
      @JacobSorber  4 ปีที่แล้ว +2

      Make doesn't really care what language you're using. So, you can just put in separate rules for your C and C++ sources. Linking them together can sometimes be a little tricky. Not a bad idea for a future video.

  • @mustafaalsenaidi4486
    @mustafaalsenaidi4486 4 ปีที่แล้ว

    what softwear do you use for writing your code and compilning it ?

    • @krystof7059
      @krystof7059 3 ปีที่แล้ว

      i think he uses Atom code editor and Clang compiler

  • @avirupdas1065
    @avirupdas1065 3 ปีที่แล้ว

    Hey, I want to generate .so files for multiple .c files that are saved in a directory so that I can use these .so files in a Python code. Is there a way to do that?

  • @activelivingchallenger4298
    @activelivingchallenger4298 4 ปีที่แล้ว

    I need to have a constant, LDFLAGS = -lpthread
    But when I put it into my rule for main:
    main.o: main.c
    $(CC) $(CFLAGS) $(LDFLAGS) -c main.c -DUSE_PROCS
    It trieds to do: clang -Wall -Wpedantic -Wextra -Werror -g -lpthread -c -main.c -DUSE_PROCS
    And gives error: -lpthread: 'linker' input unused.
    I can compile it without the -c method just fine.

    • @JacobSorber
      @JacobSorber  4 ปีที่แล้ว

      With -c, you're just compiling, not linking. So, it produces a warning that the linker-specific input isn't used. -Werror tells it to treat all warnings as errors. So, that's why the error is there.I would just save the LDFLAGS for the linking step.

  • @joncarlmatthews
    @joncarlmatthews 4 ปีที่แล้ว

    You sound *exactly* like The Modest Man.... 🤔

    • @JacobSorber
      @JacobSorber  4 ปีที่แล้ว +1

      You think so? Hmmm...

  • @aadilnazir8904
    @aadilnazir8904 2 ปีที่แล้ว

    jhony