Last active
April 4, 2019 10:36
-
-
Save wizzup/1298a13da32ab80bff7ca2856e5e2b67 to your computer and use it in GitHub Desktop.
Hello world in C with GNU autotools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# กำหนด version ต่ำสุด ของ autoconf | |
AC_PREREQ([2.69]) | |
# ตั้งชื่อ package, version และ ช่องทางสำหรับรายงาน bug | |
AC_INIT([hello], [0.0.1], [hello-bug@example.com]) | |
# ตั้งค่าเริ่มต้น automake (foreign หมายถึงไม่ใช่ GNU project คือไม่ต้องมี README, INSTALL, ..) | |
AM_INIT_AUTOMAKE([foreign]) | |
# บอก autoconf ให้สร้าง Makefile (จาก Makefile.in) | |
AC_CONFIG_FILES([Makefile]) | |
# ตรวจสอบ compiler (C)่่ | |
AC_PROG_CC | |
# สร้าง configure script และ Makefile | |
AC_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main(void){ | |
printf("Hello World\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# สร้าง binary ชื่อ hello | |
bin_PROGRAMS = hello | |
# สร้าง hello จาก main.c | |
hello_SOURCES = main.c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment